1#![doc = "MAVLink AVSSUAS dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 2u8;
21pub const DIALECT_NUMBER: u8 = 1u8;
22#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
23#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24#[cfg_attr(feature = "serde", serde(tag = "type"))]
25#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26#[repr(u32)]
27#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
28pub enum ActuatorConfiguration {
29 #[doc = "Do nothing."]
30 ACTUATOR_CONFIGURATION_NONE = 0,
31 #[doc = "Command the actuator to beep now."]
32 ACTUATOR_CONFIGURATION_BEEP = 1,
33 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
34 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
35 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
36 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
37 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
38 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
39 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
40 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
41}
42impl ActuatorConfiguration {
43 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
44}
45impl Default for ActuatorConfiguration {
46 fn default() -> Self {
47 Self::DEFAULT
48 }
49}
50#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
51#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
52#[cfg_attr(feature = "serde", serde(tag = "type"))]
53#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
54#[repr(u32)]
55#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
56pub enum ActuatorOutputFunction {
57 #[doc = "No function (disabled)."]
58 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
59 #[doc = "Motor 1"]
60 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
61 #[doc = "Motor 2"]
62 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
63 #[doc = "Motor 3"]
64 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
65 #[doc = "Motor 4"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
67 #[doc = "Motor 5"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
69 #[doc = "Motor 6"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
71 #[doc = "Motor 7"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
73 #[doc = "Motor 8"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
75 #[doc = "Motor 9"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
77 #[doc = "Motor 10"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
79 #[doc = "Motor 11"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
81 #[doc = "Motor 12"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
83 #[doc = "Motor 13"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
85 #[doc = "Motor 14"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
87 #[doc = "Motor 15"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
89 #[doc = "Motor 16"]
90 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
91 #[doc = "Servo 1"]
92 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
93 #[doc = "Servo 2"]
94 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
95 #[doc = "Servo 3"]
96 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
97 #[doc = "Servo 4"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
99 #[doc = "Servo 5"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
101 #[doc = "Servo 6"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
103 #[doc = "Servo 7"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
105 #[doc = "Servo 8"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
107 #[doc = "Servo 9"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
109 #[doc = "Servo 10"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
111 #[doc = "Servo 11"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
113 #[doc = "Servo 12"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
115 #[doc = "Servo 13"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
117 #[doc = "Servo 14"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
119 #[doc = "Servo 15"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
121 #[doc = "Servo 16"]
122 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
123}
124impl ActuatorOutputFunction {
125 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
126}
127impl Default for ActuatorOutputFunction {
128 fn default() -> Self {
129 Self::DEFAULT
130 }
131}
132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
134#[cfg_attr(feature = "serde", serde(tag = "type"))]
135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
136#[repr(u32)]
137#[doc = "Enumeration of the ADSB altimeter types"]
138pub enum AdsbAltitudeType {
139 #[doc = "Altitude reported from a Baro source using QNH reference"]
140 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
141 #[doc = "Altitude reported from a GNSS source"]
142 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
143}
144impl AdsbAltitudeType {
145 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
146}
147impl Default for AdsbAltitudeType {
148 fn default() -> Self {
149 Self::DEFAULT
150 }
151}
152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
154#[cfg_attr(feature = "serde", serde(tag = "type"))]
155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
156#[repr(u32)]
157#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
158pub enum AdsbEmitterType {
159 ADSB_EMITTER_TYPE_NO_INFO = 0,
160 ADSB_EMITTER_TYPE_LIGHT = 1,
161 ADSB_EMITTER_TYPE_SMALL = 2,
162 ADSB_EMITTER_TYPE_LARGE = 3,
163 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
164 ADSB_EMITTER_TYPE_HEAVY = 5,
165 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
166 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
167 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
168 ADSB_EMITTER_TYPE_GLIDER = 9,
169 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
170 ADSB_EMITTER_TYPE_PARACHUTE = 11,
171 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
172 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
173 ADSB_EMITTER_TYPE_UAV = 14,
174 ADSB_EMITTER_TYPE_SPACE = 15,
175 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
176 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
177 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
178 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
179}
180impl AdsbEmitterType {
181 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
182}
183impl Default for AdsbEmitterType {
184 fn default() -> Self {
185 Self::DEFAULT
186 }
187}
188bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
189impl AdsbFlags {
190 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
191}
192impl Default for AdsbFlags {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
198impl AisFlags {
199 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
200}
201impl Default for AisFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
208#[cfg_attr(feature = "serde", serde(tag = "type"))]
209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
210#[repr(u32)]
211#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
212pub enum AisNavStatus {
213 #[doc = "Under way using engine."]
214 UNDER_WAY = 0,
215 AIS_NAV_ANCHORED = 1,
216 AIS_NAV_UN_COMMANDED = 2,
217 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
218 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
219 AIS_NAV_MOORED = 5,
220 AIS_NAV_AGROUND = 6,
221 AIS_NAV_FISHING = 7,
222 AIS_NAV_SAILING = 8,
223 AIS_NAV_RESERVED_HSC = 9,
224 AIS_NAV_RESERVED_WIG = 10,
225 AIS_NAV_RESERVED_1 = 11,
226 AIS_NAV_RESERVED_2 = 12,
227 AIS_NAV_RESERVED_3 = 13,
228 #[doc = "Search And Rescue Transponder."]
229 AIS_NAV_AIS_SART = 14,
230 #[doc = "Not available (default)."]
231 AIS_NAV_UNKNOWN = 15,
232}
233impl AisNavStatus {
234 pub const DEFAULT: Self = Self::UNDER_WAY;
235}
236impl Default for AisNavStatus {
237 fn default() -> Self {
238 Self::DEFAULT
239 }
240}
241#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
243#[cfg_attr(feature = "serde", serde(tag = "type"))]
244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
245#[repr(u32)]
246#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
247pub enum AisType {
248 #[doc = "Not available (default)."]
249 AIS_TYPE_UNKNOWN = 0,
250 AIS_TYPE_RESERVED_1 = 1,
251 AIS_TYPE_RESERVED_2 = 2,
252 AIS_TYPE_RESERVED_3 = 3,
253 AIS_TYPE_RESERVED_4 = 4,
254 AIS_TYPE_RESERVED_5 = 5,
255 AIS_TYPE_RESERVED_6 = 6,
256 AIS_TYPE_RESERVED_7 = 7,
257 AIS_TYPE_RESERVED_8 = 8,
258 AIS_TYPE_RESERVED_9 = 9,
259 AIS_TYPE_RESERVED_10 = 10,
260 AIS_TYPE_RESERVED_11 = 11,
261 AIS_TYPE_RESERVED_12 = 12,
262 AIS_TYPE_RESERVED_13 = 13,
263 AIS_TYPE_RESERVED_14 = 14,
264 AIS_TYPE_RESERVED_15 = 15,
265 AIS_TYPE_RESERVED_16 = 16,
266 AIS_TYPE_RESERVED_17 = 17,
267 AIS_TYPE_RESERVED_18 = 18,
268 AIS_TYPE_RESERVED_19 = 19,
269 #[doc = "Wing In Ground effect."]
270 AIS_TYPE_WIG = 20,
271 AIS_TYPE_WIG_HAZARDOUS_A = 21,
272 AIS_TYPE_WIG_HAZARDOUS_B = 22,
273 AIS_TYPE_WIG_HAZARDOUS_C = 23,
274 AIS_TYPE_WIG_HAZARDOUS_D = 24,
275 AIS_TYPE_WIG_RESERVED_1 = 25,
276 AIS_TYPE_WIG_RESERVED_2 = 26,
277 AIS_TYPE_WIG_RESERVED_3 = 27,
278 AIS_TYPE_WIG_RESERVED_4 = 28,
279 AIS_TYPE_WIG_RESERVED_5 = 29,
280 AIS_TYPE_FISHING = 30,
281 AIS_TYPE_TOWING = 31,
282 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
283 AIS_TYPE_TOWING_LARGE = 32,
284 #[doc = "Dredging or other underwater ops."]
285 AIS_TYPE_DREDGING = 33,
286 AIS_TYPE_DIVING = 34,
287 AIS_TYPE_MILITARY = 35,
288 AIS_TYPE_SAILING = 36,
289 AIS_TYPE_PLEASURE = 37,
290 AIS_TYPE_RESERVED_20 = 38,
291 AIS_TYPE_RESERVED_21 = 39,
292 #[doc = "High Speed Craft."]
293 AIS_TYPE_HSC = 40,
294 AIS_TYPE_HSC_HAZARDOUS_A = 41,
295 AIS_TYPE_HSC_HAZARDOUS_B = 42,
296 AIS_TYPE_HSC_HAZARDOUS_C = 43,
297 AIS_TYPE_HSC_HAZARDOUS_D = 44,
298 AIS_TYPE_HSC_RESERVED_1 = 45,
299 AIS_TYPE_HSC_RESERVED_2 = 46,
300 AIS_TYPE_HSC_RESERVED_3 = 47,
301 AIS_TYPE_HSC_RESERVED_4 = 48,
302 AIS_TYPE_HSC_UNKNOWN = 49,
303 AIS_TYPE_PILOT = 50,
304 #[doc = "Search And Rescue vessel."]
305 AIS_TYPE_SAR = 51,
306 AIS_TYPE_TUG = 52,
307 AIS_TYPE_PORT_TENDER = 53,
308 #[doc = "Anti-pollution equipment."]
309 AIS_TYPE_ANTI_POLLUTION = 54,
310 AIS_TYPE_LAW_ENFORCEMENT = 55,
311 AIS_TYPE_SPARE_LOCAL_1 = 56,
312 AIS_TYPE_SPARE_LOCAL_2 = 57,
313 AIS_TYPE_MEDICAL_TRANSPORT = 58,
314 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
315 AIS_TYPE_NONECOMBATANT = 59,
316 AIS_TYPE_PASSENGER = 60,
317 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
318 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
319 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
320 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
321 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
322 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
323 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
324 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
325 AIS_TYPE_PASSENGER_UNKNOWN = 69,
326 AIS_TYPE_CARGO = 70,
327 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
328 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
329 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
330 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
331 AIS_TYPE_CARGO_RESERVED_1 = 75,
332 AIS_TYPE_CARGO_RESERVED_2 = 76,
333 AIS_TYPE_CARGO_RESERVED_3 = 77,
334 AIS_TYPE_CARGO_RESERVED_4 = 78,
335 AIS_TYPE_CARGO_UNKNOWN = 79,
336 AIS_TYPE_TANKER = 80,
337 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
338 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
339 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
340 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
341 AIS_TYPE_TANKER_RESERVED_1 = 85,
342 AIS_TYPE_TANKER_RESERVED_2 = 86,
343 AIS_TYPE_TANKER_RESERVED_3 = 87,
344 AIS_TYPE_TANKER_RESERVED_4 = 88,
345 AIS_TYPE_TANKER_UNKNOWN = 89,
346 AIS_TYPE_OTHER = 90,
347 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
348 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
349 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
350 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
351 AIS_TYPE_OTHER_RESERVED_1 = 95,
352 AIS_TYPE_OTHER_RESERVED_2 = 96,
353 AIS_TYPE_OTHER_RESERVED_3 = 97,
354 AIS_TYPE_OTHER_RESERVED_4 = 98,
355 AIS_TYPE_OTHER_UNKNOWN = 99,
356}
357impl AisType {
358 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
359}
360impl Default for AisType {
361 fn default() -> Self {
362 Self::DEFAULT
363 }
364}
365bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
366impl AttitudeTargetTypemask {
367 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
368}
369impl Default for AttitudeTargetTypemask {
370 fn default() -> Self {
371 Self::DEFAULT
372 }
373}
374#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
376#[cfg_attr(feature = "serde", serde(tag = "type"))]
377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
378#[repr(u32)]
379#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
380pub enum AutotuneAxis {
381 #[doc = "Autotune roll axis."]
382 AUTOTUNE_AXIS_ROLL = 1,
383 #[doc = "Autotune pitch axis."]
384 AUTOTUNE_AXIS_PITCH = 2,
385 #[doc = "Autotune yaw axis."]
386 AUTOTUNE_AXIS_YAW = 4,
387}
388impl AutotuneAxis {
389 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
390}
391impl Default for AutotuneAxis {
392 fn default() -> Self {
393 Self::DEFAULT
394 }
395}
396#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
398#[cfg_attr(feature = "serde", serde(tag = "type"))]
399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
400#[repr(u32)]
401pub enum AvssHorseflyOperationMode {
402 #[doc = "In manual control mode"]
403 MODE_HORSEFLY_MANUAL_CTRL = 0,
404 #[doc = "In auto takeoff mode"]
405 MODE_HORSEFLY_AUTO_TAKEOFF = 1,
406 #[doc = "In auto landing mode"]
407 MODE_HORSEFLY_AUTO_LANDING = 2,
408 #[doc = "In go home mode"]
409 MODE_HORSEFLY_NAVI_GO_HOME = 3,
410 #[doc = "In drop mode"]
411 MODE_HORSEFLY_DROP = 4,
412}
413impl AvssHorseflyOperationMode {
414 pub const DEFAULT: Self = Self::MODE_HORSEFLY_MANUAL_CTRL;
415}
416impl Default for AvssHorseflyOperationMode {
417 fn default() -> Self {
418 Self::DEFAULT
419 }
420}
421#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
423#[cfg_attr(feature = "serde", serde(tag = "type"))]
424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
425#[repr(u32)]
426pub enum AvssM300OperationMode {
427 #[doc = "In manual control mode"]
428 MODE_M300_MANUAL_CTRL = 0,
429 #[doc = "In attitude mode"]
430 MODE_M300_ATTITUDE = 1,
431 #[doc = "In GPS mode"]
432 MODE_M300_P_GPS = 6,
433 #[doc = "In hotpoint mode"]
434 MODE_M300_HOTPOINT_MODE = 9,
435 #[doc = "In assisted takeoff mode"]
436 MODE_M300_ASSISTED_TAKEOFF = 10,
437 #[doc = "In auto takeoff mode"]
438 MODE_M300_AUTO_TAKEOFF = 11,
439 #[doc = "In auto landing mode"]
440 MODE_M300_AUTO_LANDING = 12,
441 #[doc = "In go home mode"]
442 MODE_M300_NAVI_GO_HOME = 15,
443 #[doc = "In sdk control mode"]
444 MODE_M300_NAVI_SDK_CTRL = 17,
445 #[doc = "In sport mode"]
446 MODE_M300_S_SPORT = 31,
447 #[doc = "In force auto landing mode"]
448 MODE_M300_FORCE_AUTO_LANDING = 33,
449 #[doc = "In tripod mode"]
450 MODE_M300_T_TRIPOD = 38,
451 #[doc = "In search mode"]
452 MODE_M300_SEARCH_MODE = 40,
453 #[doc = "In engine mode"]
454 MODE_M300_ENGINE_START = 41,
455}
456impl AvssM300OperationMode {
457 pub const DEFAULT: Self = Self::MODE_M300_MANUAL_CTRL;
458}
459impl Default for AvssM300OperationMode {
460 fn default() -> Self {
461 Self::DEFAULT
462 }
463}
464bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
465impl CameraCapFlags {
466 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
467}
468impl Default for CameraCapFlags {
469 fn default() -> Self {
470 Self::DEFAULT
471 }
472}
473#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
475#[cfg_attr(feature = "serde", serde(tag = "type"))]
476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
477#[repr(u32)]
478#[doc = "Camera Modes."]
479pub enum CameraMode {
480 #[doc = "Camera is in image/photo capture mode."]
481 CAMERA_MODE_IMAGE = 0,
482 #[doc = "Camera is in video capture mode."]
483 CAMERA_MODE_VIDEO = 1,
484 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
485 CAMERA_MODE_IMAGE_SURVEY = 2,
486}
487impl CameraMode {
488 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
489}
490impl Default for CameraMode {
491 fn default() -> Self {
492 Self::DEFAULT
493 }
494}
495#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
497#[cfg_attr(feature = "serde", serde(tag = "type"))]
498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
499#[repr(u32)]
500#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
501pub enum CameraSource {
502 #[doc = "Default camera source."]
503 CAMERA_SOURCE_DEFAULT = 0,
504 #[doc = "RGB camera source."]
505 CAMERA_SOURCE_RGB = 1,
506 #[doc = "IR camera source."]
507 CAMERA_SOURCE_IR = 2,
508 #[doc = "NDVI camera source."]
509 CAMERA_SOURCE_NDVI = 3,
510}
511impl CameraSource {
512 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
513}
514impl Default for CameraSource {
515 fn default() -> Self {
516 Self::DEFAULT
517 }
518}
519#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
521#[cfg_attr(feature = "serde", serde(tag = "type"))]
522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
523#[repr(u32)]
524#[doc = "Camera tracking modes"]
525pub enum CameraTrackingMode {
526 #[doc = "Not tracking"]
527 CAMERA_TRACKING_MODE_NONE = 0,
528 #[doc = "Target is a point"]
529 CAMERA_TRACKING_MODE_POINT = 1,
530 #[doc = "Target is a rectangle"]
531 CAMERA_TRACKING_MODE_RECTANGLE = 2,
532}
533impl CameraTrackingMode {
534 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
535}
536impl Default for CameraTrackingMode {
537 fn default() -> Self {
538 Self::DEFAULT
539 }
540}
541#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
543#[cfg_attr(feature = "serde", serde(tag = "type"))]
544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
545#[repr(u32)]
546#[doc = "Camera tracking status flags"]
547pub enum CameraTrackingStatusFlags {
548 #[doc = "Camera is not tracking"]
549 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
550 #[doc = "Camera is tracking"]
551 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
552 #[doc = "Camera tracking in error state"]
553 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
554}
555impl CameraTrackingStatusFlags {
556 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
557}
558impl Default for CameraTrackingStatusFlags {
559 fn default() -> Self {
560 Self::DEFAULT
561 }
562}
563bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
564impl CameraTrackingTargetData {
565 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
566}
567impl Default for CameraTrackingTargetData {
568 fn default() -> Self {
569 Self::DEFAULT
570 }
571}
572#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
574#[cfg_attr(feature = "serde", serde(tag = "type"))]
575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
576#[repr(u32)]
577#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
578pub enum CameraZoomType {
579 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
580 ZOOM_TYPE_STEP = 0,
581 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
582 ZOOM_TYPE_CONTINUOUS = 1,
583 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
584 ZOOM_TYPE_RANGE = 2,
585 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
586 ZOOM_TYPE_FOCAL_LENGTH = 3,
587 #[doc = "Zoom value as horizontal field of view in degrees."]
588 ZOOM_TYPE_HORIZONTAL_FOV = 4,
589}
590impl CameraZoomType {
591 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
592}
593impl Default for CameraZoomType {
594 fn default() -> Self {
595 Self::DEFAULT
596 }
597}
598#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
600#[cfg_attr(feature = "serde", serde(tag = "type"))]
601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
602#[repr(u32)]
603pub enum CanFilterOp {
604 CAN_FILTER_REPLACE = 0,
605 CAN_FILTER_ADD = 1,
606 CAN_FILTER_REMOVE = 2,
607}
608impl CanFilterOp {
609 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
610}
611impl Default for CanFilterOp {
612 fn default() -> Self {
613 Self::DEFAULT
614 }
615}
616#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
618#[cfg_attr(feature = "serde", serde(tag = "type"))]
619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
620#[repr(u32)]
621#[doc = "Possible responses from a CELLULAR_CONFIG message."]
622pub enum CellularConfigResponse {
623 #[doc = "Changes accepted."]
624 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
625 #[doc = "Invalid APN."]
626 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
627 #[doc = "Invalid PIN."]
628 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
629 #[doc = "Changes rejected."]
630 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
631 #[doc = "PUK is required to unblock SIM card."]
632 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
633}
634impl CellularConfigResponse {
635 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
636}
637impl Default for CellularConfigResponse {
638 fn default() -> Self {
639 Self::DEFAULT
640 }
641}
642#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
644#[cfg_attr(feature = "serde", serde(tag = "type"))]
645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
646#[repr(u32)]
647#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
648pub enum CellularNetworkFailedReason {
649 #[doc = "No error"]
650 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
651 #[doc = "Error state is unknown"]
652 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
653 #[doc = "SIM is required for the modem but missing"]
654 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
655 #[doc = "SIM is available, but not usable for connection"]
656 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
657}
658impl CellularNetworkFailedReason {
659 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
660}
661impl Default for CellularNetworkFailedReason {
662 fn default() -> Self {
663 Self::DEFAULT
664 }
665}
666#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
668#[cfg_attr(feature = "serde", serde(tag = "type"))]
669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
670#[repr(u32)]
671#[doc = "Cellular network radio type"]
672pub enum CellularNetworkRadioType {
673 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
674 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
675 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
676 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
677 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
678}
679impl CellularNetworkRadioType {
680 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
681}
682impl Default for CellularNetworkRadioType {
683 fn default() -> Self {
684 Self::DEFAULT
685 }
686}
687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
689#[cfg_attr(feature = "serde", serde(tag = "type"))]
690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
691#[repr(u32)]
692#[doc = "These flags encode the cellular network status"]
693pub enum CellularStatusFlag {
694 #[doc = "State unknown or not reportable."]
695 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
696 #[doc = "Modem is unusable"]
697 CELLULAR_STATUS_FLAG_FAILED = 1,
698 #[doc = "Modem is being initialized"]
699 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
700 #[doc = "Modem is locked"]
701 CELLULAR_STATUS_FLAG_LOCKED = 3,
702 #[doc = "Modem is not enabled and is powered down"]
703 CELLULAR_STATUS_FLAG_DISABLED = 4,
704 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
705 CELLULAR_STATUS_FLAG_DISABLING = 5,
706 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
707 CELLULAR_STATUS_FLAG_ENABLING = 6,
708 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
709 CELLULAR_STATUS_FLAG_ENABLED = 7,
710 #[doc = "Modem is searching for a network provider to register"]
711 CELLULAR_STATUS_FLAG_SEARCHING = 8,
712 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
713 CELLULAR_STATUS_FLAG_REGISTERED = 9,
714 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
715 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
716 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
717 CELLULAR_STATUS_FLAG_CONNECTING = 11,
718 #[doc = "One or more packet data bearers is active and connected"]
719 CELLULAR_STATUS_FLAG_CONNECTED = 12,
720}
721impl CellularStatusFlag {
722 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
723}
724impl Default for CellularStatusFlag {
725 fn default() -> Self {
726 Self::DEFAULT
727 }
728}
729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
731#[cfg_attr(feature = "serde", serde(tag = "type"))]
732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
733#[repr(u32)]
734#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
735pub enum CompMetadataType {
736 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
737 COMP_METADATA_TYPE_GENERAL = 0,
738 #[doc = "Parameter meta data."]
739 COMP_METADATA_TYPE_PARAMETER = 1,
740 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
741 COMP_METADATA_TYPE_COMMANDS = 2,
742 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
743 COMP_METADATA_TYPE_PERIPHERALS = 3,
744 #[doc = "Meta data for the events interface."]
745 COMP_METADATA_TYPE_EVENTS = 4,
746 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
747 COMP_METADATA_TYPE_ACTUATORS = 5,
748}
749impl CompMetadataType {
750 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
751}
752impl Default for CompMetadataType {
753 fn default() -> Self {
754 Self::DEFAULT
755 }
756}
757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
759#[cfg_attr(feature = "serde", serde(tag = "type"))]
760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
761#[repr(u32)]
762#[doc = "Indicates the ESC connection type."]
763pub enum EscConnectionType {
764 #[doc = "Traditional PPM ESC."]
765 ESC_CONNECTION_TYPE_PPM = 0,
766 #[doc = "Serial Bus connected ESC."]
767 ESC_CONNECTION_TYPE_SERIAL = 1,
768 #[doc = "One Shot PPM ESC."]
769 ESC_CONNECTION_TYPE_ONESHOT = 2,
770 #[doc = "I2C ESC."]
771 ESC_CONNECTION_TYPE_I2C = 3,
772 #[doc = "CAN-Bus ESC."]
773 ESC_CONNECTION_TYPE_CAN = 4,
774 #[doc = "DShot ESC."]
775 ESC_CONNECTION_TYPE_DSHOT = 5,
776}
777impl EscConnectionType {
778 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
779}
780impl Default for EscConnectionType {
781 fn default() -> Self {
782 Self::DEFAULT
783 }
784}
785bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
786impl EscFailureFlags {
787 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
788}
789impl Default for EscFailureFlags {
790 fn default() -> Self {
791 Self::DEFAULT
792 }
793}
794bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
795impl EstimatorStatusFlags {
796 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
797}
798impl Default for EstimatorStatusFlags {
799 fn default() -> Self {
800 Self::DEFAULT
801 }
802}
803#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
805#[cfg_attr(feature = "serde", serde(tag = "type"))]
806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
807#[repr(u32)]
808#[doc = "List of possible failure type to inject."]
809pub enum FailureType {
810 #[doc = "No failure injected, used to reset a previous failure."]
811 FAILURE_TYPE_OK = 0,
812 #[doc = "Sets unit off, so completely non-responsive."]
813 FAILURE_TYPE_OFF = 1,
814 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
815 FAILURE_TYPE_STUCK = 2,
816 #[doc = "Unit is reporting complete garbage."]
817 FAILURE_TYPE_GARBAGE = 3,
818 #[doc = "Unit is consistently wrong."]
819 FAILURE_TYPE_WRONG = 4,
820 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
821 FAILURE_TYPE_SLOW = 5,
822 #[doc = "Data of unit is delayed in time."]
823 FAILURE_TYPE_DELAYED = 6,
824 #[doc = "Unit is sometimes working, sometimes not."]
825 FAILURE_TYPE_INTERMITTENT = 7,
826}
827impl FailureType {
828 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
829}
830impl Default for FailureType {
831 fn default() -> Self {
832 Self::DEFAULT
833 }
834}
835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
837#[cfg_attr(feature = "serde", serde(tag = "type"))]
838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
839#[repr(u32)]
840#[doc = "List of possible units where failures can be injected."]
841pub enum FailureUnit {
842 FAILURE_UNIT_SENSOR_GYRO = 0,
843 FAILURE_UNIT_SENSOR_ACCEL = 1,
844 FAILURE_UNIT_SENSOR_MAG = 2,
845 FAILURE_UNIT_SENSOR_BARO = 3,
846 FAILURE_UNIT_SENSOR_GPS = 4,
847 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
848 FAILURE_UNIT_SENSOR_VIO = 6,
849 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
850 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
851 FAILURE_UNIT_SYSTEM_BATTERY = 100,
852 FAILURE_UNIT_SYSTEM_MOTOR = 101,
853 FAILURE_UNIT_SYSTEM_SERVO = 102,
854 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
855 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
856 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
857}
858impl FailureUnit {
859 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
860}
861impl Default for FailureUnit {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871pub enum FenceBreach {
872 #[doc = "No last fence breach"]
873 FENCE_BREACH_NONE = 0,
874 #[doc = "Breached minimum altitude"]
875 FENCE_BREACH_MINALT = 1,
876 #[doc = "Breached maximum altitude"]
877 FENCE_BREACH_MAXALT = 2,
878 #[doc = "Breached fence boundary"]
879 FENCE_BREACH_BOUNDARY = 3,
880}
881impl FenceBreach {
882 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
883}
884impl Default for FenceBreach {
885 fn default() -> Self {
886 Self::DEFAULT
887 }
888}
889#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
891#[cfg_attr(feature = "serde", serde(tag = "type"))]
892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
893#[repr(u32)]
894#[doc = "Actions being taken to mitigate/prevent fence breach"]
895pub enum FenceMitigate {
896 #[doc = "Unknown"]
897 FENCE_MITIGATE_UNKNOWN = 0,
898 #[doc = "No actions being taken"]
899 FENCE_MITIGATE_NONE = 1,
900 #[doc = "Velocity limiting active to prevent breach"]
901 FENCE_MITIGATE_VEL_LIMIT = 2,
902}
903impl FenceMitigate {
904 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
905}
906impl Default for FenceMitigate {
907 fn default() -> Self {
908 Self::DEFAULT
909 }
910}
911#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
913#[cfg_attr(feature = "serde", serde(tag = "type"))]
914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
915#[repr(u32)]
916#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
917pub enum FenceType {
918 #[doc = "Maximum altitude fence"]
919 FENCE_TYPE_ALT_MAX = 1,
920 #[doc = "Circle fence"]
921 FENCE_TYPE_CIRCLE = 2,
922 #[doc = "Polygon fence"]
923 FENCE_TYPE_POLYGON = 4,
924 #[doc = "Minimum altitude fence"]
925 FENCE_TYPE_ALT_MIN = 8,
926}
927impl FenceType {
928 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
929}
930impl Default for FenceType {
931 fn default() -> Self {
932 Self::DEFAULT
933 }
934}
935#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
937#[cfg_attr(feature = "serde", serde(tag = "type"))]
938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
939#[repr(u32)]
940#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
941pub enum FirmwareVersionType {
942 #[doc = "development release"]
943 FIRMWARE_VERSION_TYPE_DEV = 0,
944 #[doc = "alpha release"]
945 FIRMWARE_VERSION_TYPE_ALPHA = 64,
946 #[doc = "beta release"]
947 FIRMWARE_VERSION_TYPE_BETA = 128,
948 #[doc = "release candidate"]
949 FIRMWARE_VERSION_TYPE_RC = 192,
950 #[doc = "official stable release"]
951 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
952}
953impl FirmwareVersionType {
954 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
955}
956impl Default for FirmwareVersionType {
957 fn default() -> Self {
958 Self::DEFAULT
959 }
960}
961bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
962impl GimbalDeviceCapFlags {
963 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
964}
965impl Default for GimbalDeviceCapFlags {
966 fn default() -> Self {
967 Self::DEFAULT
968 }
969}
970bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
971impl GimbalDeviceErrorFlags {
972 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
973}
974impl Default for GimbalDeviceErrorFlags {
975 fn default() -> Self {
976 Self::DEFAULT
977 }
978}
979bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
980impl GimbalDeviceFlags {
981 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
982}
983impl Default for GimbalDeviceFlags {
984 fn default() -> Self {
985 Self::DEFAULT
986 }
987}
988bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
989impl GimbalManagerCapFlags {
990 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
991}
992impl Default for GimbalManagerCapFlags {
993 fn default() -> Self {
994 Self::DEFAULT
995 }
996}
997bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
998impl GimbalManagerFlags {
999 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1000}
1001impl Default for GimbalManagerFlags {
1002 fn default() -> Self {
1003 Self::DEFAULT
1004 }
1005}
1006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1008#[cfg_attr(feature = "serde", serde(tag = "type"))]
1009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1010#[repr(u32)]
1011#[doc = "Type of GPS fix"]
1012pub enum GpsFixType {
1013 #[doc = "No GPS connected"]
1014 GPS_FIX_TYPE_NO_GPS = 0,
1015 #[doc = "No position information, GPS is connected"]
1016 GPS_FIX_TYPE_NO_FIX = 1,
1017 #[doc = "2D position"]
1018 GPS_FIX_TYPE_2D_FIX = 2,
1019 #[doc = "3D position"]
1020 GPS_FIX_TYPE_3D_FIX = 3,
1021 #[doc = "DGPS/SBAS aided 3D position"]
1022 GPS_FIX_TYPE_DGPS = 4,
1023 #[doc = "RTK float, 3D position"]
1024 GPS_FIX_TYPE_RTK_FLOAT = 5,
1025 #[doc = "RTK Fixed, 3D position"]
1026 GPS_FIX_TYPE_RTK_FIXED = 6,
1027 #[doc = "Static fixed, typically used for base stations"]
1028 GPS_FIX_TYPE_STATIC = 7,
1029 #[doc = "PPP, 3D position."]
1030 GPS_FIX_TYPE_PPP = 8,
1031}
1032impl GpsFixType {
1033 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1034}
1035impl Default for GpsFixType {
1036 fn default() -> Self {
1037 Self::DEFAULT
1038 }
1039}
1040bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1041impl GpsInputIgnoreFlags {
1042 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1043}
1044impl Default for GpsInputIgnoreFlags {
1045 fn default() -> Self {
1046 Self::DEFAULT
1047 }
1048}
1049#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1051#[cfg_attr(feature = "serde", serde(tag = "type"))]
1052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1053#[repr(u32)]
1054#[doc = "Gripper actions."]
1055pub enum GripperActions {
1056 #[doc = "Gripper release cargo."]
1057 GRIPPER_ACTION_RELEASE = 0,
1058 #[doc = "Gripper grab onto cargo."]
1059 GRIPPER_ACTION_GRAB = 1,
1060}
1061impl GripperActions {
1062 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1063}
1064impl Default for GripperActions {
1065 fn default() -> Self {
1066 Self::DEFAULT
1067 }
1068}
1069bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1070impl HighresImuUpdatedFlags {
1071 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1072}
1073impl Default for HighresImuUpdatedFlags {
1074 fn default() -> Self {
1075 Self::DEFAULT
1076 }
1077}
1078bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1079impl HilActuatorControlsFlags {
1080 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1081}
1082impl Default for HilActuatorControlsFlags {
1083 fn default() -> Self {
1084 Self::DEFAULT
1085 }
1086}
1087bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1088impl HilSensorUpdatedFlags {
1089 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1090}
1091impl Default for HilSensorUpdatedFlags {
1092 fn default() -> Self {
1093 Self::DEFAULT
1094 }
1095}
1096bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1097impl HlFailureFlag {
1098 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1099}
1100impl Default for HlFailureFlag {
1101 fn default() -> Self {
1102 Self::DEFAULT
1103 }
1104}
1105bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1106impl IlluminatorErrorFlags {
1107 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1108}
1109impl Default for IlluminatorErrorFlags {
1110 fn default() -> Self {
1111 Self::DEFAULT
1112 }
1113}
1114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1116#[cfg_attr(feature = "serde", serde(tag = "type"))]
1117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1118#[repr(u32)]
1119#[doc = "Modes of illuminator"]
1120pub enum IlluminatorMode {
1121 #[doc = "Illuminator mode is not specified/unknown"]
1122 ILLUMINATOR_MODE_UNKNOWN = 0,
1123 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1124 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1125 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1126 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1127}
1128impl IlluminatorMode {
1129 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1130}
1131impl Default for IlluminatorMode {
1132 fn default() -> Self {
1133 Self::DEFAULT
1134 }
1135}
1136#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1138#[cfg_attr(feature = "serde", serde(tag = "type"))]
1139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1140#[repr(u32)]
1141#[doc = "Type of landing target"]
1142pub enum LandingTargetType {
1143 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1144 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1145 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1146 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1147 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1148 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1149 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1150 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1151}
1152impl LandingTargetType {
1153 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1154}
1155impl Default for LandingTargetType {
1156 fn default() -> Self {
1157 Self::DEFAULT
1158 }
1159}
1160#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1162#[cfg_attr(feature = "serde", serde(tag = "type"))]
1163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1164#[repr(u32)]
1165pub enum MagCalStatus {
1166 MAG_CAL_NOT_STARTED = 0,
1167 MAG_CAL_WAITING_TO_START = 1,
1168 MAG_CAL_RUNNING_STEP_ONE = 2,
1169 MAG_CAL_RUNNING_STEP_TWO = 3,
1170 MAG_CAL_SUCCESS = 4,
1171 MAG_CAL_FAILED = 5,
1172 MAG_CAL_BAD_ORIENTATION = 6,
1173 MAG_CAL_BAD_RADIUS = 7,
1174}
1175impl MagCalStatus {
1176 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1177}
1178impl Default for MagCalStatus {
1179 fn default() -> Self {
1180 Self::DEFAULT
1181 }
1182}
1183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1185#[cfg_attr(feature = "serde", serde(tag = "type"))]
1186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1187#[repr(u32)]
1188pub enum MavArmAuthDeniedReason {
1189 #[doc = "Not a specific reason"]
1190 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1191 #[doc = "Authorizer will send the error as string to GCS"]
1192 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1193 #[doc = "At least one waypoint have a invalid value"]
1194 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1195 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1196 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1197 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1198 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1199 #[doc = "Weather is not good to fly"]
1200 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1201}
1202impl MavArmAuthDeniedReason {
1203 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1204}
1205impl Default for MavArmAuthDeniedReason {
1206 fn default() -> Self {
1207 Self::DEFAULT
1208 }
1209}
1210#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1212#[cfg_attr(feature = "serde", serde(tag = "type"))]
1213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1214#[repr(u32)]
1215#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1216pub enum MavAutopilot {
1217 #[doc = "Generic autopilot, full support for everything"]
1218 MAV_AUTOPILOT_GENERIC = 0,
1219 #[doc = "Reserved for future use."]
1220 MAV_AUTOPILOT_RESERVED = 1,
1221 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1222 MAV_AUTOPILOT_SLUGS = 2,
1223 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1224 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1225 #[doc = "OpenPilot, <http://openpilot.org>"]
1226 MAV_AUTOPILOT_OPENPILOT = 4,
1227 #[doc = "Generic autopilot only supporting simple waypoints"]
1228 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1229 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1230 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1231 #[doc = "Generic autopilot supporting the full mission command set"]
1232 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1233 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1234 MAV_AUTOPILOT_INVALID = 8,
1235 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1236 MAV_AUTOPILOT_PPZ = 9,
1237 #[doc = "UAV Dev Board"]
1238 MAV_AUTOPILOT_UDB = 10,
1239 #[doc = "FlexiPilot"]
1240 MAV_AUTOPILOT_FP = 11,
1241 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1242 MAV_AUTOPILOT_PX4 = 12,
1243 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1244 MAV_AUTOPILOT_SMACCMPILOT = 13,
1245 #[doc = "AutoQuad -- <http://autoquad.org>"]
1246 MAV_AUTOPILOT_AUTOQUAD = 14,
1247 #[doc = "Armazila -- <http://armazila.com>"]
1248 MAV_AUTOPILOT_ARMAZILA = 15,
1249 #[doc = "Aerob -- <http://aerob.ru>"]
1250 MAV_AUTOPILOT_AEROB = 16,
1251 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1252 MAV_AUTOPILOT_ASLUAV = 17,
1253 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1254 MAV_AUTOPILOT_SMARTAP = 18,
1255 #[doc = "AirRails - <http://uaventure.com>"]
1256 MAV_AUTOPILOT_AIRRAILS = 19,
1257 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1258 MAV_AUTOPILOT_REFLEX = 20,
1259}
1260impl MavAutopilot {
1261 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1262}
1263impl Default for MavAutopilot {
1264 fn default() -> Self {
1265 Self::DEFAULT
1266 }
1267}
1268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1270#[cfg_attr(feature = "serde", serde(tag = "type"))]
1271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1272#[repr(u32)]
1273pub enum MavAvssCommandFailureReason {
1274 #[doc = "AVSS defined command failure reason. PRS not steady."]
1275 PRS_NOT_STEADY = 1,
1276 #[doc = "AVSS defined command failure reason. PRS DTM not armed."]
1277 PRS_DTM_NOT_ARMED = 2,
1278 #[doc = "AVSS defined command failure reason. PRS OTM not armed."]
1279 PRS_OTM_NOT_ARMED = 3,
1280}
1281impl MavAvssCommandFailureReason {
1282 pub const DEFAULT: Self = Self::PRS_NOT_STEADY;
1283}
1284impl Default for MavAvssCommandFailureReason {
1285 fn default() -> Self {
1286 Self::DEFAULT
1287 }
1288}
1289#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1291#[cfg_attr(feature = "serde", serde(tag = "type"))]
1292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1293#[repr(u32)]
1294#[doc = "Enumeration for battery charge states."]
1295pub enum MavBatteryChargeState {
1296 #[doc = "Low battery state is not provided"]
1297 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1298 #[doc = "Battery is not in low state. Normal operation."]
1299 MAV_BATTERY_CHARGE_STATE_OK = 1,
1300 #[doc = "Battery state is low, warn and monitor close."]
1301 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1302 #[doc = "Battery state is critical, return or abort immediately."]
1303 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1304 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1305 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1306 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1307 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1308 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1309 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1310 #[doc = "Battery is charging."]
1311 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1312}
1313impl MavBatteryChargeState {
1314 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1315}
1316impl Default for MavBatteryChargeState {
1317 fn default() -> Self {
1318 Self::DEFAULT
1319 }
1320}
1321bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1322impl MavBatteryFault {
1323 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1324}
1325impl Default for MavBatteryFault {
1326 fn default() -> Self {
1327 Self::DEFAULT
1328 }
1329}
1330#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1332#[cfg_attr(feature = "serde", serde(tag = "type"))]
1333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1334#[repr(u32)]
1335#[doc = "Enumeration of battery functions"]
1336pub enum MavBatteryFunction {
1337 #[doc = "Battery function is unknown"]
1338 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1339 #[doc = "Battery supports all flight systems"]
1340 MAV_BATTERY_FUNCTION_ALL = 1,
1341 #[doc = "Battery for the propulsion system"]
1342 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1343 #[doc = "Avionics battery"]
1344 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1345 #[doc = "Payload battery"]
1346 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1347}
1348impl MavBatteryFunction {
1349 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1350}
1351impl Default for MavBatteryFunction {
1352 fn default() -> Self {
1353 Self::DEFAULT
1354 }
1355}
1356#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1358#[cfg_attr(feature = "serde", serde(tag = "type"))]
1359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1360#[repr(u32)]
1361#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1362pub enum MavBatteryMode {
1363 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1364 MAV_BATTERY_MODE_UNKNOWN = 0,
1365 #[doc = "Battery is auto discharging (towards storage level)."]
1366 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1367 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1368 MAV_BATTERY_MODE_HOT_SWAP = 2,
1369}
1370impl MavBatteryMode {
1371 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1372}
1373impl Default for MavBatteryMode {
1374 fn default() -> Self {
1375 Self::DEFAULT
1376 }
1377}
1378#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1380#[cfg_attr(feature = "serde", serde(tag = "type"))]
1381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1382#[repr(u32)]
1383#[doc = "Enumeration of battery types"]
1384pub enum MavBatteryType {
1385 #[doc = "Not specified."]
1386 MAV_BATTERY_TYPE_UNKNOWN = 0,
1387 #[doc = "Lithium polymer battery"]
1388 MAV_BATTERY_TYPE_LIPO = 1,
1389 #[doc = "Lithium-iron-phosphate battery"]
1390 MAV_BATTERY_TYPE_LIFE = 2,
1391 #[doc = "Lithium-ION battery"]
1392 MAV_BATTERY_TYPE_LION = 3,
1393 #[doc = "Nickel metal hydride battery"]
1394 MAV_BATTERY_TYPE_NIMH = 4,
1395}
1396impl MavBatteryType {
1397 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1398}
1399impl Default for MavBatteryType {
1400 fn default() -> Self {
1401 Self::DEFAULT
1402 }
1403}
1404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1406#[cfg_attr(feature = "serde", serde(tag = "type"))]
1407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1408#[repr(u32)]
1409#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1410pub enum MavCmd {
1411 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1412 MAV_CMD_NAV_WAYPOINT = 16,
1413 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1414 MAV_CMD_NAV_LOITER_UNLIM = 17,
1415 #[doc = "Loiter around this waypoint for X turns"]
1416 MAV_CMD_NAV_LOITER_TURNS = 18,
1417 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1418 MAV_CMD_NAV_LOITER_TIME = 19,
1419 #[doc = "Return to launch location"]
1420 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1421 #[doc = "Land at location."]
1422 MAV_CMD_NAV_LAND = 21,
1423 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1424 MAV_CMD_NAV_TAKEOFF = 22,
1425 #[doc = "Land at local position (local frame only)"]
1426 MAV_CMD_NAV_LAND_LOCAL = 23,
1427 #[doc = "Takeoff from local position (local frame only)"]
1428 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1429 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1430 MAV_CMD_NAV_FOLLOW = 25,
1431 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1432 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1433 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1434 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1435 #[doc = "Begin following a target"]
1436 MAV_CMD_DO_FOLLOW = 32,
1437 #[doc = "Reposition the MAV after a follow target command has been sent"]
1438 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1439 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1440 MAV_CMD_DO_ORBIT = 34,
1441 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1442 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1443 MAV_CMD_NAV_ROI = 80,
1444 #[doc = "Control autonomous path planning on the MAV."]
1445 MAV_CMD_NAV_PATHPLANNING = 81,
1446 #[doc = "Navigate to waypoint using a spline path."]
1447 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1448 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1449 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1450 #[doc = "Land using VTOL mode"]
1451 MAV_CMD_NAV_VTOL_LAND = 85,
1452 #[doc = "hand control over to an external controller"]
1453 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1454 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1455 MAV_CMD_NAV_DELAY = 93,
1456 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1457 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1458 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1459 MAV_CMD_NAV_LAST = 95,
1460 #[doc = "Delay mission state machine."]
1461 MAV_CMD_CONDITION_DELAY = 112,
1462 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1463 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1464 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1465 MAV_CMD_CONDITION_DISTANCE = 114,
1466 #[doc = "Reach a certain target angle."]
1467 MAV_CMD_CONDITION_YAW = 115,
1468 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1469 MAV_CMD_CONDITION_LAST = 159,
1470 #[doc = "Set system mode."]
1471 MAV_CMD_DO_SET_MODE = 176,
1472 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1473 MAV_CMD_DO_JUMP = 177,
1474 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1475 MAV_CMD_DO_CHANGE_SPEED = 178,
1476 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1477 MAV_CMD_DO_SET_HOME = 179,
1478 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1479 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1480 MAV_CMD_DO_SET_PARAMETER = 180,
1481 #[doc = "Set a relay to a condition."]
1482 MAV_CMD_DO_SET_RELAY = 181,
1483 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1484 MAV_CMD_DO_REPEAT_RELAY = 182,
1485 #[doc = "Set a servo to a desired PWM value."]
1486 MAV_CMD_DO_SET_SERVO = 183,
1487 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1488 MAV_CMD_DO_REPEAT_SERVO = 184,
1489 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1490 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1491 #[doc = "Change altitude set point."]
1492 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1493 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1494 MAV_CMD_DO_SET_ACTUATOR = 187,
1495 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1496 MAV_CMD_DO_RETURN_PATH_START = 188,
1497 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1498 MAV_CMD_DO_LAND_START = 189,
1499 #[doc = "Mission command to perform a landing from a rally point."]
1500 MAV_CMD_DO_RALLY_LAND = 190,
1501 #[doc = "Mission command to safely abort an autonomous landing."]
1502 MAV_CMD_DO_GO_AROUND = 191,
1503 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1504 MAV_CMD_DO_REPOSITION = 192,
1505 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1506 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1507 #[doc = "Set moving direction to forward or reverse."]
1508 MAV_CMD_DO_SET_REVERSE = 194,
1509 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1510 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1511 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1512 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1513 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1514 MAV_CMD_DO_SET_ROI_NONE = 197,
1515 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1516 MAV_CMD_DO_SET_ROI_SYSID = 198,
1517 #[doc = "Control onboard camera system."]
1518 MAV_CMD_DO_CONTROL_VIDEO = 200,
1519 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1520 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1521 MAV_CMD_DO_SET_ROI = 201,
1522 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1523 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1524 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1525 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1526 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1527 #[doc = "Mission command to configure a camera or antenna mount"]
1528 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1529 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1530 #[doc = "Mission command to control a camera or antenna mount"]
1531 MAV_CMD_DO_MOUNT_CONTROL = 205,
1532 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1533 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1534 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1535 MAV_CMD_DO_FENCE_ENABLE = 207,
1536 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1537 MAV_CMD_DO_PARACHUTE = 208,
1538 #[doc = "Command to perform motor test."]
1539 MAV_CMD_DO_MOTOR_TEST = 209,
1540 #[doc = "Change to/from inverted flight."]
1541 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1542 #[doc = "Mission command to operate a gripper."]
1543 MAV_CMD_DO_GRIPPER = 211,
1544 #[doc = "Enable/disable autotune."]
1545 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1546 #[doc = "Sets a desired vehicle turn angle and speed change."]
1547 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1548 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1549 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1550 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1551 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1552 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1553 #[doc = "set id of master controller"]
1554 MAV_CMD_DO_GUIDED_MASTER = 221,
1555 #[doc = "Set limits for external control"]
1556 MAV_CMD_DO_GUIDED_LIMITS = 222,
1557 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1558 MAV_CMD_DO_ENGINE_CONTROL = 223,
1559 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1560 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1561 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1562 MAV_CMD_DO_LAST = 240,
1563 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1564 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1565 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1566 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1567 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1568 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1569 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1570 MAV_CMD_PREFLIGHT_STORAGE = 245,
1571 #[doc = "Request the reboot or shutdown of system components."]
1572 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1573 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1574 MAV_CMD_OVERRIDE_GOTO = 252,
1575 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1576 MAV_CMD_OBLIQUE_SURVEY = 260,
1577 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1578 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1579 #[doc = "start running a mission"]
1580 MAV_CMD_MISSION_START = 300,
1581 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1582 MAV_CMD_ACTUATOR_TEST = 310,
1583 #[doc = "Actuator configuration command."]
1584 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1585 #[doc = "Arms / Disarms a component"]
1586 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1587 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1588 MAV_CMD_RUN_PREARM_CHECKS = 401,
1589 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1590 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1591 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1592 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1594 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1595 MAV_CMD_GET_HOME_POSITION = 410,
1596 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1597 MAV_CMD_INJECT_FAILURE = 420,
1598 #[doc = "Starts receiver pairing."]
1599 MAV_CMD_START_RX_PAIR = 500,
1600 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1601 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1602 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1603 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1604 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1605 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1606 MAV_CMD_REQUEST_MESSAGE = 512,
1607 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1608 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1609 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1612 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1615 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1616 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1617 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1618 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1619 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1620 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1621 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1622 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1623 MAV_CMD_STORAGE_FORMAT = 526,
1624 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1625 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1626 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1627 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1628 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1629 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1630 #[doc = "Reset all camera settings to Factory Default"]
1631 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1632 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1633 MAV_CMD_SET_CAMERA_MODE = 530,
1634 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1635 MAV_CMD_SET_CAMERA_ZOOM = 531,
1636 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1637 MAV_CMD_SET_CAMERA_FOCUS = 532,
1638 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1639 MAV_CMD_SET_STORAGE_USAGE = 533,
1640 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1641 MAV_CMD_SET_CAMERA_SOURCE = 534,
1642 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1643 MAV_CMD_JUMP_TAG = 600,
1644 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1645 MAV_CMD_DO_JUMP_TAG = 601,
1646 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1647 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1648 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1649 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1650 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1651 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1652 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1653 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1654 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1655 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1656 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1657 #[doc = "Enable or disable on-board camera triggering system."]
1658 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1659 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1660 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1661 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1662 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1663 #[doc = "Stops ongoing tracking."]
1664 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1665 #[doc = "Starts video capture (recording)."]
1666 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1667 #[doc = "Stop the current video capture (recording)."]
1668 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1669 #[doc = "Start video streaming"]
1670 MAV_CMD_VIDEO_START_STREAMING = 2502,
1671 #[doc = "Stop the given video stream"]
1672 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1673 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1674 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1675 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1676 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1677 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1678 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1679 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1680 MAV_CMD_LOGGING_START = 2510,
1681 #[doc = "Request to stop streaming log data over MAVLink"]
1682 MAV_CMD_LOGGING_STOP = 2511,
1683 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1684 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1685 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1686 #[doc = "Create a panorama at the current position"]
1687 MAV_CMD_PANORAMA_CREATE = 2800,
1688 #[doc = "Request VTOL transition"]
1689 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1690 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1691 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1692 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1693 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1694 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1695 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1696 #[doc = "Delay mission state machine until gate has been reached."]
1697 MAV_CMD_CONDITION_GATE = 4501,
1698 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1699 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1700 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1701 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1702 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1703 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1704 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1705 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1706 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1707 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1708 #[doc = "Rally point. You can have multiple rally points defined."]
1709 MAV_CMD_NAV_RALLY_POINT = 5100,
1710 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1711 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1712 #[doc = "Change state of safety switch."]
1713 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1714 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1715 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1716 #[deprecated = " (Deprecated since 2021-06)"]
1717 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1718 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1719 #[deprecated = " (Deprecated since 2021-06)"]
1720 #[doc = "Control the payload deployment."]
1721 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1722 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1723 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1724 #[doc = "Command to operate winch."]
1725 MAV_CMD_DO_WINCH = 42600,
1726 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1727 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1728 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1729 MAV_CMD_WAYPOINT_USER_1 = 31000,
1730 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1731 MAV_CMD_WAYPOINT_USER_2 = 31001,
1732 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1733 MAV_CMD_WAYPOINT_USER_3 = 31002,
1734 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1735 MAV_CMD_WAYPOINT_USER_4 = 31003,
1736 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1737 MAV_CMD_WAYPOINT_USER_5 = 31004,
1738 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1739 MAV_CMD_SPATIAL_USER_1 = 31005,
1740 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1741 MAV_CMD_SPATIAL_USER_2 = 31006,
1742 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1743 MAV_CMD_SPATIAL_USER_3 = 31007,
1744 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1745 MAV_CMD_SPATIAL_USER_4 = 31008,
1746 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1747 MAV_CMD_SPATIAL_USER_5 = 31009,
1748 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1749 MAV_CMD_USER_1 = 31010,
1750 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1751 MAV_CMD_USER_2 = 31011,
1752 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1753 MAV_CMD_USER_3 = 31012,
1754 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1755 MAV_CMD_USER_4 = 31013,
1756 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1757 MAV_CMD_USER_5 = 31014,
1758 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1759 MAV_CMD_CAN_FORWARD = 32000,
1760 #[doc = "AVSS defined command. Set PRS arm statuses."]
1761 MAV_CMD_PRS_SET_ARM = 60050,
1762 #[doc = "AVSS defined command. Gets PRS arm statuses"]
1763 MAV_CMD_PRS_GET_ARM = 60051,
1764 #[doc = "AVSS defined command. Get the PRS battery voltage in millivolts"]
1765 MAV_CMD_PRS_GET_BATTERY = 60052,
1766 #[doc = "AVSS defined command. Get the PRS error statuses."]
1767 MAV_CMD_PRS_GET_ERR = 60053,
1768 #[doc = "AVSS defined command. Set the ATS arming altitude in meters."]
1769 MAV_CMD_PRS_SET_ARM_ALTI = 60070,
1770 #[doc = "AVSS defined command. Get the ATS arming altitude in meters."]
1771 MAV_CMD_PRS_GET_ARM_ALTI = 60071,
1772 #[doc = "AVSS defined command. Shuts down the PRS system."]
1773 MAV_CMD_PRS_SHUTDOWN = 60072,
1774}
1775impl MavCmd {
1776 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1777}
1778impl Default for MavCmd {
1779 fn default() -> Self {
1780 Self::DEFAULT
1781 }
1782}
1783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1785#[cfg_attr(feature = "serde", serde(tag = "type"))]
1786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1787#[repr(u32)]
1788#[doc = "Possible actions an aircraft can take to avoid a collision."]
1789pub enum MavCollisionAction {
1790 #[doc = "Ignore any potential collisions"]
1791 MAV_COLLISION_ACTION_NONE = 0,
1792 #[doc = "Report potential collision"]
1793 MAV_COLLISION_ACTION_REPORT = 1,
1794 #[doc = "Ascend or Descend to avoid threat"]
1795 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1796 #[doc = "Move horizontally to avoid threat"]
1797 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1798 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1799 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1800 #[doc = "Aircraft to fly directly back to its launch point"]
1801 MAV_COLLISION_ACTION_RTL = 5,
1802 #[doc = "Aircraft to stop in place"]
1803 MAV_COLLISION_ACTION_HOVER = 6,
1804}
1805impl MavCollisionAction {
1806 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1807}
1808impl Default for MavCollisionAction {
1809 fn default() -> Self {
1810 Self::DEFAULT
1811 }
1812}
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Source of information about this collision."]
1819pub enum MavCollisionSrc {
1820 #[doc = "ID field references ADSB_VEHICLE packets"]
1821 MAV_COLLISION_SRC_ADSB = 0,
1822 #[doc = "ID field references MAVLink SRC ID"]
1823 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1824}
1825impl MavCollisionSrc {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1827}
1828impl Default for MavCollisionSrc {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1835#[cfg_attr(feature = "serde", serde(tag = "type"))]
1836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1837#[repr(u32)]
1838#[doc = "Aircraft-rated danger from this threat."]
1839pub enum MavCollisionThreatLevel {
1840 #[doc = "Not a threat"]
1841 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1842 #[doc = "Craft is mildly concerned about this threat"]
1843 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1844 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1845 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1846}
1847impl MavCollisionThreatLevel {
1848 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1849}
1850impl Default for MavCollisionThreatLevel {
1851 fn default() -> Self {
1852 Self::DEFAULT
1853 }
1854}
1855#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1857#[cfg_attr(feature = "serde", serde(tag = "type"))]
1858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1859#[repr(u32)]
1860#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1861pub enum MavComponent {
1862 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1863 MAV_COMP_ID_ALL = 0,
1864 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1865 MAV_COMP_ID_AUTOPILOT1 = 1,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER1 = 25,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER2 = 26,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER3 = 27,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER4 = 28,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER5 = 29,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER6 = 30,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER7 = 31,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER8 = 32,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER9 = 33,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER10 = 34,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER11 = 35,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER12 = 36,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER13 = 37,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER14 = 38,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER15 = 39,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER16 = 40,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER17 = 41,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER18 = 42,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER19 = 43,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER20 = 44,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER21 = 45,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER22 = 46,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER23 = 47,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER24 = 48,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER25 = 49,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER26 = 50,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER27 = 51,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER28 = 52,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER29 = 53,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER30 = 54,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER31 = 55,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER32 = 56,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER33 = 57,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER34 = 58,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER35 = 59,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER36 = 60,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER37 = 61,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER38 = 62,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER39 = 63,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER40 = 64,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER41 = 65,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER42 = 66,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER43 = 67,
1952 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1953 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER45 = 69,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER46 = 70,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER47 = 71,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER48 = 72,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER49 = 73,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER50 = 74,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER51 = 75,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER52 = 76,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER53 = 77,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER54 = 78,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER55 = 79,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER56 = 80,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER57 = 81,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER58 = 82,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER59 = 83,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER60 = 84,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER61 = 85,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER62 = 86,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER63 = 87,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER64 = 88,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER65 = 89,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER66 = 90,
1998 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1999 MAV_COMP_ID_USER67 = 91,
2000 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2001 MAV_COMP_ID_USER68 = 92,
2002 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2003 MAV_COMP_ID_USER69 = 93,
2004 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2005 MAV_COMP_ID_USER70 = 94,
2006 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2007 MAV_COMP_ID_USER71 = 95,
2008 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2009 MAV_COMP_ID_USER72 = 96,
2010 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2011 MAV_COMP_ID_USER73 = 97,
2012 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2013 MAV_COMP_ID_USER74 = 98,
2014 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2015 MAV_COMP_ID_USER75 = 99,
2016 #[doc = "Camera #1."]
2017 MAV_COMP_ID_CAMERA = 100,
2018 #[doc = "Camera #2."]
2019 MAV_COMP_ID_CAMERA2 = 101,
2020 #[doc = "Camera #3."]
2021 MAV_COMP_ID_CAMERA3 = 102,
2022 #[doc = "Camera #4."]
2023 MAV_COMP_ID_CAMERA4 = 103,
2024 #[doc = "Camera #5."]
2025 MAV_COMP_ID_CAMERA5 = 104,
2026 #[doc = "Camera #6."]
2027 MAV_COMP_ID_CAMERA6 = 105,
2028 #[doc = "Servo #1."]
2029 MAV_COMP_ID_SERVO1 = 140,
2030 #[doc = "Servo #2."]
2031 MAV_COMP_ID_SERVO2 = 141,
2032 #[doc = "Servo #3."]
2033 MAV_COMP_ID_SERVO3 = 142,
2034 #[doc = "Servo #4."]
2035 MAV_COMP_ID_SERVO4 = 143,
2036 #[doc = "Servo #5."]
2037 MAV_COMP_ID_SERVO5 = 144,
2038 #[doc = "Servo #6."]
2039 MAV_COMP_ID_SERVO6 = 145,
2040 #[doc = "Servo #7."]
2041 MAV_COMP_ID_SERVO7 = 146,
2042 #[doc = "Servo #8."]
2043 MAV_COMP_ID_SERVO8 = 147,
2044 #[doc = "Servo #9."]
2045 MAV_COMP_ID_SERVO9 = 148,
2046 #[doc = "Servo #10."]
2047 MAV_COMP_ID_SERVO10 = 149,
2048 #[doc = "Servo #11."]
2049 MAV_COMP_ID_SERVO11 = 150,
2050 #[doc = "Servo #12."]
2051 MAV_COMP_ID_SERVO12 = 151,
2052 #[doc = "Servo #13."]
2053 MAV_COMP_ID_SERVO13 = 152,
2054 #[doc = "Servo #14."]
2055 MAV_COMP_ID_SERVO14 = 153,
2056 #[doc = "Gimbal #1."]
2057 MAV_COMP_ID_GIMBAL = 154,
2058 #[doc = "Logging component."]
2059 MAV_COMP_ID_LOG = 155,
2060 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2061 MAV_COMP_ID_ADSB = 156,
2062 #[doc = "On Screen Display (OSD) devices for video links."]
2063 MAV_COMP_ID_OSD = 157,
2064 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2065 MAV_COMP_ID_PERIPHERAL = 158,
2066 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2067 #[doc = "Gimbal ID for QX1."]
2068 MAV_COMP_ID_QX1_GIMBAL = 159,
2069 #[doc = "FLARM collision alert component."]
2070 MAV_COMP_ID_FLARM = 160,
2071 #[doc = "Parachute component."]
2072 MAV_COMP_ID_PARACHUTE = 161,
2073 #[doc = "Winch component."]
2074 MAV_COMP_ID_WINCH = 169,
2075 #[doc = "Gimbal #2."]
2076 MAV_COMP_ID_GIMBAL2 = 171,
2077 #[doc = "Gimbal #3."]
2078 MAV_COMP_ID_GIMBAL3 = 172,
2079 #[doc = "Gimbal #4"]
2080 MAV_COMP_ID_GIMBAL4 = 173,
2081 #[doc = "Gimbal #5."]
2082 MAV_COMP_ID_GIMBAL5 = 174,
2083 #[doc = "Gimbal #6."]
2084 MAV_COMP_ID_GIMBAL6 = 175,
2085 #[doc = "Battery #1."]
2086 MAV_COMP_ID_BATTERY = 180,
2087 #[doc = "Battery #2."]
2088 MAV_COMP_ID_BATTERY2 = 181,
2089 #[doc = "CAN over MAVLink client."]
2090 MAV_COMP_ID_MAVCAN = 189,
2091 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2092 MAV_COMP_ID_MISSIONPLANNER = 190,
2093 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2094 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2095 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2096 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2097 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2098 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2099 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2100 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2101 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2102 MAV_COMP_ID_PATHPLANNER = 195,
2103 #[doc = "Component that plans a collision free path between two points."]
2104 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2105 #[doc = "Component that provides position estimates using VIO techniques."]
2106 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2107 #[doc = "Component that manages pairing of vehicle and GCS."]
2108 MAV_COMP_ID_PAIRING_MANAGER = 198,
2109 #[doc = "Inertial Measurement Unit (IMU) #1."]
2110 MAV_COMP_ID_IMU = 200,
2111 #[doc = "Inertial Measurement Unit (IMU) #2."]
2112 MAV_COMP_ID_IMU_2 = 201,
2113 #[doc = "Inertial Measurement Unit (IMU) #3."]
2114 MAV_COMP_ID_IMU_3 = 202,
2115 #[doc = "GPS #1."]
2116 MAV_COMP_ID_GPS = 220,
2117 #[doc = "GPS #2."]
2118 MAV_COMP_ID_GPS2 = 221,
2119 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2120 MAV_COMP_ID_ODID_TXRX_1 = 236,
2121 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2122 MAV_COMP_ID_ODID_TXRX_2 = 237,
2123 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2124 MAV_COMP_ID_ODID_TXRX_3 = 238,
2125 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2126 MAV_COMP_ID_UDP_BRIDGE = 240,
2127 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2128 MAV_COMP_ID_UART_BRIDGE = 241,
2129 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2130 MAV_COMP_ID_TUNNEL_NODE = 242,
2131 #[doc = "Illuminator"]
2132 MAV_COMP_ID_ILLUMINATOR = 243,
2133 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2134 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2135 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2136}
2137impl MavComponent {
2138 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2139}
2140impl Default for MavComponent {
2141 fn default() -> Self {
2142 Self::DEFAULT
2143 }
2144}
2145#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2147#[cfg_attr(feature = "serde", serde(tag = "type"))]
2148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2149#[repr(u32)]
2150#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2151#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2152pub enum MavDataStream {
2153 #[doc = "Enable all data streams"]
2154 MAV_DATA_STREAM_ALL = 0,
2155 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2156 MAV_DATA_STREAM_RAW_SENSORS = 1,
2157 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2158 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2159 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2160 MAV_DATA_STREAM_RC_CHANNELS = 3,
2161 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2162 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2163 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2164 MAV_DATA_STREAM_POSITION = 6,
2165 #[doc = "Dependent on the autopilot"]
2166 MAV_DATA_STREAM_EXTRA1 = 10,
2167 #[doc = "Dependent on the autopilot"]
2168 MAV_DATA_STREAM_EXTRA2 = 11,
2169 #[doc = "Dependent on the autopilot"]
2170 MAV_DATA_STREAM_EXTRA3 = 12,
2171}
2172impl MavDataStream {
2173 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2174}
2175impl Default for MavDataStream {
2176 fn default() -> Self {
2177 Self::DEFAULT
2178 }
2179}
2180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2182#[cfg_attr(feature = "serde", serde(tag = "type"))]
2183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2184#[repr(u32)]
2185#[doc = "Enumeration of distance sensor types"]
2186pub enum MavDistanceSensor {
2187 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2188 MAV_DISTANCE_SENSOR_LASER = 0,
2189 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2190 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2191 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2192 MAV_DISTANCE_SENSOR_INFRARED = 2,
2193 #[doc = "Radar type, e.g. uLanding units"]
2194 MAV_DISTANCE_SENSOR_RADAR = 3,
2195 #[doc = "Broken or unknown type, e.g. analog units"]
2196 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2197}
2198impl MavDistanceSensor {
2199 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2200}
2201impl Default for MavDistanceSensor {
2202 fn default() -> Self {
2203 Self::DEFAULT
2204 }
2205}
2206#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2208#[cfg_attr(feature = "serde", serde(tag = "type"))]
2209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2210#[repr(u32)]
2211#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2212pub enum MavDoRepositionFlags {
2213 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2214 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2215}
2216impl MavDoRepositionFlags {
2217 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2218}
2219impl Default for MavDoRepositionFlags {
2220 fn default() -> Self {
2221 Self::DEFAULT
2222 }
2223}
2224#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2226#[cfg_attr(feature = "serde", serde(tag = "type"))]
2227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2228#[repr(u32)]
2229#[doc = "Enumeration of estimator types"]
2230pub enum MavEstimatorType {
2231 #[doc = "Unknown type of the estimator."]
2232 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2233 #[doc = "This is a naive estimator without any real covariance feedback."]
2234 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2235 #[doc = "Computer vision based estimate. Might be up to scale."]
2236 MAV_ESTIMATOR_TYPE_VISION = 2,
2237 #[doc = "Visual-inertial estimate."]
2238 MAV_ESTIMATOR_TYPE_VIO = 3,
2239 #[doc = "Plain GPS estimate."]
2240 MAV_ESTIMATOR_TYPE_GPS = 4,
2241 #[doc = "Estimator integrating GPS and inertial sensing."]
2242 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2243 #[doc = "Estimate from external motion capturing system."]
2244 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2245 #[doc = "Estimator based on lidar sensor input."]
2246 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2247 #[doc = "Estimator on autopilot."]
2248 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2249}
2250impl MavEstimatorType {
2251 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2252}
2253impl Default for MavEstimatorType {
2254 fn default() -> Self {
2255 Self::DEFAULT
2256 }
2257}
2258#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2260#[cfg_attr(feature = "serde", serde(tag = "type"))]
2261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2262#[repr(u32)]
2263#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2264pub enum MavEventCurrentSequenceFlags {
2265 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2266 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2267}
2268impl MavEventCurrentSequenceFlags {
2269 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2270}
2271impl Default for MavEventCurrentSequenceFlags {
2272 fn default() -> Self {
2273 Self::DEFAULT
2274 }
2275}
2276#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2278#[cfg_attr(feature = "serde", serde(tag = "type"))]
2279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2280#[repr(u32)]
2281#[doc = "Reason for an event error response."]
2282pub enum MavEventErrorReason {
2283 #[doc = "The requested event is not available (anymore)."]
2284 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2285}
2286impl MavEventErrorReason {
2287 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2288}
2289impl Default for MavEventErrorReason {
2290 fn default() -> Self {
2291 Self::DEFAULT
2292 }
2293}
2294#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2296#[cfg_attr(feature = "serde", serde(tag = "type"))]
2297#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2298#[repr(u32)]
2299#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2300pub enum MavFrame {
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2302 MAV_FRAME_GLOBAL = 0,
2303 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_NED = 1,
2305 #[doc = "NOT a coordinate frame, indicates a mission command."]
2306 MAV_FRAME_MISSION = 2,
2307 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2308 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2309 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2310 MAV_FRAME_LOCAL_ENU = 4,
2311 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2312 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2313 MAV_FRAME_GLOBAL_INT = 5,
2314 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2315 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2316 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2317 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2318 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2319 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2320 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2321 MAV_FRAME_BODY_NED = 8,
2322 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2323 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2324 MAV_FRAME_BODY_OFFSET_NED = 9,
2325 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2326 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2327 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2328 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2329 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2330 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2331 MAV_FRAME_BODY_FRD = 12,
2332 #[deprecated = " (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2334 MAV_FRAME_RESERVED_13 = 13,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_14 = 14,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_15 = 15,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_16 = 16,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_17 = 17,
2347 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2348 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2349 MAV_FRAME_RESERVED_18 = 18,
2350 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2351 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2352 MAV_FRAME_RESERVED_19 = 19,
2353 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2354 MAV_FRAME_LOCAL_FRD = 20,
2355 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2356 MAV_FRAME_LOCAL_FLU = 21,
2357}
2358impl MavFrame {
2359 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2360}
2361impl Default for MavFrame {
2362 fn default() -> Self {
2363 Self::DEFAULT
2364 }
2365}
2366#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2368#[cfg_attr(feature = "serde", serde(tag = "type"))]
2369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2370#[repr(u32)]
2371#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2372pub enum MavFtpErr {
2373 #[doc = "None: No error"]
2374 MAV_FTP_ERR_NONE = 0,
2375 #[doc = "Fail: Unknown failure"]
2376 MAV_FTP_ERR_FAIL = 1,
2377 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2378 MAV_FTP_ERR_FAILERRNO = 2,
2379 #[doc = "InvalidDataSize: Payload size is invalid"]
2380 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2381 #[doc = "InvalidSession: Session is not currently open"]
2382 MAV_FTP_ERR_INVALIDSESSION = 4,
2383 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2384 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2385 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2386 MAV_FTP_ERR_EOF = 6,
2387 #[doc = "UnknownCommand: Unknown command / opcode"]
2388 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2389 #[doc = "FileExists: File/directory already exists"]
2390 MAV_FTP_ERR_FILEEXISTS = 8,
2391 #[doc = "FileProtected: File/directory is write protected"]
2392 MAV_FTP_ERR_FILEPROTECTED = 9,
2393 #[doc = "FileNotFound: File/directory not found"]
2394 MAV_FTP_ERR_FILENOTFOUND = 10,
2395}
2396impl MavFtpErr {
2397 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2398}
2399impl Default for MavFtpErr {
2400 fn default() -> Self {
2401 Self::DEFAULT
2402 }
2403}
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2489#[cfg_attr(feature = "serde", serde(tag = "type"))]
2490#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2491#[repr(u32)]
2492#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2493pub enum MavGoto {
2494 #[doc = "Hold at the current position."]
2495 MAV_GOTO_DO_HOLD = 0,
2496 #[doc = "Continue with the next item in mission execution."]
2497 MAV_GOTO_DO_CONTINUE = 1,
2498 #[doc = "Hold at the current position of the system"]
2499 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2500 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2501 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2502}
2503impl MavGoto {
2504 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2505}
2506impl Default for MavGoto {
2507 fn default() -> Self {
2508 Self::DEFAULT
2509 }
2510}
2511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2513#[cfg_attr(feature = "serde", serde(tag = "type"))]
2514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2515#[repr(u32)]
2516#[doc = "Enumeration of landed detector states"]
2517pub enum MavLandedState {
2518 #[doc = "MAV landed state is unknown"]
2519 MAV_LANDED_STATE_UNDEFINED = 0,
2520 #[doc = "MAV is landed (on ground)"]
2521 MAV_LANDED_STATE_ON_GROUND = 1,
2522 #[doc = "MAV is in air"]
2523 MAV_LANDED_STATE_IN_AIR = 2,
2524 #[doc = "MAV currently taking off"]
2525 MAV_LANDED_STATE_TAKEOFF = 3,
2526 #[doc = "MAV currently landing"]
2527 MAV_LANDED_STATE_LANDING = 4,
2528}
2529impl MavLandedState {
2530 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2531}
2532impl Default for MavLandedState {
2533 fn default() -> Self {
2534 Self::DEFAULT
2535 }
2536}
2537#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2539#[cfg_attr(feature = "serde", serde(tag = "type"))]
2540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2541#[repr(u32)]
2542#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2543pub enum MavMissionResult {
2544 #[doc = "mission accepted OK"]
2545 MAV_MISSION_ACCEPTED = 0,
2546 #[doc = "Generic error / not accepting mission commands at all right now."]
2547 MAV_MISSION_ERROR = 1,
2548 #[doc = "Coordinate frame is not supported."]
2549 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2550 #[doc = "Command is not supported."]
2551 MAV_MISSION_UNSUPPORTED = 3,
2552 #[doc = "Mission items exceed storage space."]
2553 MAV_MISSION_NO_SPACE = 4,
2554 #[doc = "One of the parameters has an invalid value."]
2555 MAV_MISSION_INVALID = 5,
2556 #[doc = "param1 has an invalid value."]
2557 MAV_MISSION_INVALID_PARAM1 = 6,
2558 #[doc = "param2 has an invalid value."]
2559 MAV_MISSION_INVALID_PARAM2 = 7,
2560 #[doc = "param3 has an invalid value."]
2561 MAV_MISSION_INVALID_PARAM3 = 8,
2562 #[doc = "param4 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM4 = 9,
2564 #[doc = "x / param5 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM5_X = 10,
2566 #[doc = "y / param6 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM6_Y = 11,
2568 #[doc = "z / param7 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM7 = 12,
2570 #[doc = "Mission item received out of sequence"]
2571 MAV_MISSION_INVALID_SEQUENCE = 13,
2572 #[doc = "Not accepting any mission commands from this communication partner."]
2573 MAV_MISSION_DENIED = 14,
2574 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2575 MAV_MISSION_OPERATION_CANCELLED = 15,
2576}
2577impl MavMissionResult {
2578 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2579}
2580impl Default for MavMissionResult {
2581 fn default() -> Self {
2582 Self::DEFAULT
2583 }
2584}
2585#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2586#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2587#[cfg_attr(feature = "serde", serde(tag = "type"))]
2588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2589#[repr(u32)]
2590#[doc = "Type of mission items being requested/sent in mission protocol."]
2591pub enum MavMissionType {
2592 #[doc = "Items are mission commands for main mission."]
2593 MAV_MISSION_TYPE_MISSION = 0,
2594 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2595 MAV_MISSION_TYPE_FENCE = 1,
2596 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2597 MAV_MISSION_TYPE_RALLY = 2,
2598 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2599 MAV_MISSION_TYPE_ALL = 255,
2600}
2601impl MavMissionType {
2602 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2603}
2604impl Default for MavMissionType {
2605 fn default() -> Self {
2606 Self::DEFAULT
2607 }
2608}
2609#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2611#[cfg_attr(feature = "serde", serde(tag = "type"))]
2612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2613#[repr(u32)]
2614#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2615pub enum MavMode {
2616 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2617 MAV_MODE_PREFLIGHT = 0,
2618 #[doc = "System is allowed to be active, under assisted RC control."]
2619 MAV_MODE_STABILIZE_DISARMED = 80,
2620 #[doc = "System is allowed to be active, under assisted RC control."]
2621 MAV_MODE_STABILIZE_ARMED = 208,
2622 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2623 MAV_MODE_MANUAL_DISARMED = 64,
2624 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2625 MAV_MODE_MANUAL_ARMED = 192,
2626 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2627 MAV_MODE_GUIDED_DISARMED = 88,
2628 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2629 MAV_MODE_GUIDED_ARMED = 216,
2630 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2631 MAV_MODE_AUTO_DISARMED = 92,
2632 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2633 MAV_MODE_AUTO_ARMED = 220,
2634 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2635 MAV_MODE_TEST_DISARMED = 66,
2636 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2637 MAV_MODE_TEST_ARMED = 194,
2638}
2639impl MavMode {
2640 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2641}
2642impl Default for MavMode {
2643 fn default() -> Self {
2644 Self::DEFAULT
2645 }
2646}
2647bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2648impl MavModeFlag {
2649 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2650}
2651impl Default for MavModeFlag {
2652 fn default() -> Self {
2653 Self::DEFAULT
2654 }
2655}
2656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2658#[cfg_attr(feature = "serde", serde(tag = "type"))]
2659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2660#[repr(u32)]
2661#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2662pub enum MavModeFlagDecodePosition {
2663 #[doc = "First bit: 10000000"]
2664 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2665 #[doc = "Second bit: 01000000"]
2666 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2667 #[doc = "Third bit: 00100000"]
2668 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2669 #[doc = "Fourth bit: 00010000"]
2670 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2671 #[doc = "Fifth bit: 00001000"]
2672 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2673 #[doc = "Sixth bit: 00000100"]
2674 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2675 #[doc = "Seventh bit: 00000010"]
2676 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2677 #[doc = "Eighth bit: 00000001"]
2678 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2679}
2680impl MavModeFlagDecodePosition {
2681 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2682}
2683impl Default for MavModeFlagDecodePosition {
2684 fn default() -> Self {
2685 Self::DEFAULT
2686 }
2687}
2688bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2689impl MavModeProperty {
2690 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2691}
2692impl Default for MavModeProperty {
2693 fn default() -> Self {
2694 Self::DEFAULT
2695 }
2696}
2697#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2699#[cfg_attr(feature = "serde", serde(tag = "type"))]
2700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2701#[repr(u32)]
2702#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2703#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2704pub enum MavMountMode {
2705 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2706 MAV_MOUNT_MODE_RETRACT = 0,
2707 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2708 MAV_MOUNT_MODE_NEUTRAL = 1,
2709 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2710 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2711 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2712 MAV_MOUNT_MODE_RC_TARGETING = 3,
2713 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2714 MAV_MOUNT_MODE_GPS_POINT = 4,
2715 #[doc = "Gimbal tracks system with specified system ID"]
2716 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2717 #[doc = "Gimbal tracks home position"]
2718 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2719}
2720impl MavMountMode {
2721 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2722}
2723impl Default for MavMountMode {
2724 fn default() -> Self {
2725 Self::DEFAULT
2726 }
2727}
2728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2730#[cfg_attr(feature = "serde", serde(tag = "type"))]
2731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2732#[repr(u32)]
2733pub enum MavOdidArmStatus {
2734 #[doc = "Passing arming checks."]
2735 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2736 #[doc = "Generic arming failure, see error string for details."]
2737 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2738}
2739impl MavOdidArmStatus {
2740 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2741}
2742impl Default for MavOdidArmStatus {
2743 fn default() -> Self {
2744 Self::DEFAULT
2745 }
2746}
2747#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2749#[cfg_attr(feature = "serde", serde(tag = "type"))]
2750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2751#[repr(u32)]
2752pub enum MavOdidAuthType {
2753 #[doc = "No authentication type is specified."]
2754 MAV_ODID_AUTH_TYPE_NONE = 0,
2755 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2756 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2757 #[doc = "Signature for the Operator ID."]
2758 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2759 #[doc = "Signature for the entire message set."]
2760 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2761 #[doc = "Authentication is provided by Network Remote ID."]
2762 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2763 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2764 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2765}
2766impl MavOdidAuthType {
2767 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2768}
2769impl Default for MavOdidAuthType {
2770 fn default() -> Self {
2771 Self::DEFAULT
2772 }
2773}
2774#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2776#[cfg_attr(feature = "serde", serde(tag = "type"))]
2777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2778#[repr(u32)]
2779pub enum MavOdidCategoryEu {
2780 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2781 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2782 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2783 MAV_ODID_CATEGORY_EU_OPEN = 1,
2784 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2785 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2786 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2787 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2788}
2789impl MavOdidCategoryEu {
2790 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2791}
2792impl Default for MavOdidCategoryEu {
2793 fn default() -> Self {
2794 Self::DEFAULT
2795 }
2796}
2797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2799#[cfg_attr(feature = "serde", serde(tag = "type"))]
2800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2801#[repr(u32)]
2802pub enum MavOdidClassEu {
2803 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2804 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2805 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2806 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2807 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2808 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2809 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2810 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2811 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2812 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2813 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2814 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2815 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2816 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2817 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2818 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2819}
2820impl MavOdidClassEu {
2821 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2822}
2823impl Default for MavOdidClassEu {
2824 fn default() -> Self {
2825 Self::DEFAULT
2826 }
2827}
2828#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2830#[cfg_attr(feature = "serde", serde(tag = "type"))]
2831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2832#[repr(u32)]
2833pub enum MavOdidClassificationType {
2834 #[doc = "The classification type for the UA is undeclared."]
2835 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2836 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2837 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2838}
2839impl MavOdidClassificationType {
2840 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2841}
2842impl Default for MavOdidClassificationType {
2843 fn default() -> Self {
2844 Self::DEFAULT
2845 }
2846}
2847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2849#[cfg_attr(feature = "serde", serde(tag = "type"))]
2850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2851#[repr(u32)]
2852pub enum MavOdidDescType {
2853 #[doc = "Optional free-form text description of the purpose of the flight."]
2854 MAV_ODID_DESC_TYPE_TEXT = 0,
2855 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2856 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2857 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2858 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2859}
2860impl MavOdidDescType {
2861 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2862}
2863impl Default for MavOdidDescType {
2864 fn default() -> Self {
2865 Self::DEFAULT
2866 }
2867}
2868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2870#[cfg_attr(feature = "serde", serde(tag = "type"))]
2871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2872#[repr(u32)]
2873pub enum MavOdidHeightRef {
2874 #[doc = "The height field is relative to the take-off location."]
2875 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2876 #[doc = "The height field is relative to ground."]
2877 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2878}
2879impl MavOdidHeightRef {
2880 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2881}
2882impl Default for MavOdidHeightRef {
2883 fn default() -> Self {
2884 Self::DEFAULT
2885 }
2886}
2887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2889#[cfg_attr(feature = "serde", serde(tag = "type"))]
2890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2891#[repr(u32)]
2892pub enum MavOdidHorAcc {
2893 #[doc = "The horizontal accuracy is unknown."]
2894 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2895 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2896 MAV_ODID_HOR_ACC_10NM = 1,
2897 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2898 MAV_ODID_HOR_ACC_4NM = 2,
2899 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2900 MAV_ODID_HOR_ACC_2NM = 3,
2901 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2902 MAV_ODID_HOR_ACC_1NM = 4,
2903 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2904 MAV_ODID_HOR_ACC_0_5NM = 5,
2905 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2906 MAV_ODID_HOR_ACC_0_3NM = 6,
2907 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2908 MAV_ODID_HOR_ACC_0_1NM = 7,
2909 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2910 MAV_ODID_HOR_ACC_0_05NM = 8,
2911 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2912 MAV_ODID_HOR_ACC_30_METER = 9,
2913 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2914 MAV_ODID_HOR_ACC_10_METER = 10,
2915 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2916 MAV_ODID_HOR_ACC_3_METER = 11,
2917 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2918 MAV_ODID_HOR_ACC_1_METER = 12,
2919}
2920impl MavOdidHorAcc {
2921 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2922}
2923impl Default for MavOdidHorAcc {
2924 fn default() -> Self {
2925 Self::DEFAULT
2926 }
2927}
2928#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2930#[cfg_attr(feature = "serde", serde(tag = "type"))]
2931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2932#[repr(u32)]
2933pub enum MavOdidIdType {
2934 #[doc = "No type defined."]
2935 MAV_ODID_ID_TYPE_NONE = 0,
2936 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2937 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2938 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2939 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2940 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2941 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2942 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2943 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2944}
2945impl MavOdidIdType {
2946 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2947}
2948impl Default for MavOdidIdType {
2949 fn default() -> Self {
2950 Self::DEFAULT
2951 }
2952}
2953#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2955#[cfg_attr(feature = "serde", serde(tag = "type"))]
2956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2957#[repr(u32)]
2958pub enum MavOdidOperatorIdType {
2959 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2960 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2961}
2962impl MavOdidOperatorIdType {
2963 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2964}
2965impl Default for MavOdidOperatorIdType {
2966 fn default() -> Self {
2967 Self::DEFAULT
2968 }
2969}
2970#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2972#[cfg_attr(feature = "serde", serde(tag = "type"))]
2973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2974#[repr(u32)]
2975pub enum MavOdidOperatorLocationType {
2976 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2977 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2978 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2979 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2980 #[doc = "The location/altitude of the operator are fixed values."]
2981 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2982}
2983impl MavOdidOperatorLocationType {
2984 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2985}
2986impl Default for MavOdidOperatorLocationType {
2987 fn default() -> Self {
2988 Self::DEFAULT
2989 }
2990}
2991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2993#[cfg_attr(feature = "serde", serde(tag = "type"))]
2994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2995#[repr(u32)]
2996pub enum MavOdidSpeedAcc {
2997 #[doc = "The speed accuracy is unknown."]
2998 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2999 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3000 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3001 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3002 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3003 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3004 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3005 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3006 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3007}
3008impl MavOdidSpeedAcc {
3009 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3010}
3011impl Default for MavOdidSpeedAcc {
3012 fn default() -> Self {
3013 Self::DEFAULT
3014 }
3015}
3016#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3018#[cfg_attr(feature = "serde", serde(tag = "type"))]
3019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3020#[repr(u32)]
3021pub enum MavOdidStatus {
3022 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3023 MAV_ODID_STATUS_UNDECLARED = 0,
3024 #[doc = "The UA is on the ground."]
3025 MAV_ODID_STATUS_GROUND = 1,
3026 #[doc = "The UA is in the air."]
3027 MAV_ODID_STATUS_AIRBORNE = 2,
3028 #[doc = "The UA is having an emergency."]
3029 MAV_ODID_STATUS_EMERGENCY = 3,
3030 #[doc = "The remote ID system is failing or unreliable in some way."]
3031 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3032}
3033impl MavOdidStatus {
3034 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3035}
3036impl Default for MavOdidStatus {
3037 fn default() -> Self {
3038 Self::DEFAULT
3039 }
3040}
3041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3043#[cfg_attr(feature = "serde", serde(tag = "type"))]
3044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3045#[repr(u32)]
3046pub enum MavOdidTimeAcc {
3047 #[doc = "The timestamp accuracy is unknown."]
3048 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3049 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3050 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3051 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3052 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3053 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3054 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3055 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3056 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3057 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3058 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3059 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3060 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3061 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3062 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3063 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3064 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3065 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3066 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3067 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3068 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3069 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3070 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3071 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3072 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3073 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3074 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3075 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3076 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3077 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3078 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3079}
3080impl MavOdidTimeAcc {
3081 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3082}
3083impl Default for MavOdidTimeAcc {
3084 fn default() -> Self {
3085 Self::DEFAULT
3086 }
3087}
3088#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3090#[cfg_attr(feature = "serde", serde(tag = "type"))]
3091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3092#[repr(u32)]
3093pub enum MavOdidUaType {
3094 #[doc = "No UA (Unmanned Aircraft) type defined."]
3095 MAV_ODID_UA_TYPE_NONE = 0,
3096 #[doc = "Aeroplane/Airplane. Fixed wing."]
3097 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3098 #[doc = "Helicopter or multirotor."]
3099 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3100 #[doc = "Gyroplane."]
3101 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3102 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3103 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3104 #[doc = "Ornithopter."]
3105 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3106 #[doc = "Glider."]
3107 MAV_ODID_UA_TYPE_GLIDER = 6,
3108 #[doc = "Kite."]
3109 MAV_ODID_UA_TYPE_KITE = 7,
3110 #[doc = "Free Balloon."]
3111 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3112 #[doc = "Captive Balloon."]
3113 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3114 #[doc = "Airship. E.g. a blimp."]
3115 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3116 #[doc = "Free Fall/Parachute (unpowered)."]
3117 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3118 #[doc = "Rocket."]
3119 MAV_ODID_UA_TYPE_ROCKET = 12,
3120 #[doc = "Tethered powered aircraft."]
3121 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3122 #[doc = "Ground Obstacle."]
3123 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3124 #[doc = "Other type of aircraft not listed earlier."]
3125 MAV_ODID_UA_TYPE_OTHER = 15,
3126}
3127impl MavOdidUaType {
3128 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3129}
3130impl Default for MavOdidUaType {
3131 fn default() -> Self {
3132 Self::DEFAULT
3133 }
3134}
3135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3137#[cfg_attr(feature = "serde", serde(tag = "type"))]
3138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3139#[repr(u32)]
3140pub enum MavOdidVerAcc {
3141 #[doc = "The vertical accuracy is unknown."]
3142 MAV_ODID_VER_ACC_UNKNOWN = 0,
3143 #[doc = "The vertical accuracy is smaller than 150 meter."]
3144 MAV_ODID_VER_ACC_150_METER = 1,
3145 #[doc = "The vertical accuracy is smaller than 45 meter."]
3146 MAV_ODID_VER_ACC_45_METER = 2,
3147 #[doc = "The vertical accuracy is smaller than 25 meter."]
3148 MAV_ODID_VER_ACC_25_METER = 3,
3149 #[doc = "The vertical accuracy is smaller than 10 meter."]
3150 MAV_ODID_VER_ACC_10_METER = 4,
3151 #[doc = "The vertical accuracy is smaller than 3 meter."]
3152 MAV_ODID_VER_ACC_3_METER = 5,
3153 #[doc = "The vertical accuracy is smaller than 1 meter."]
3154 MAV_ODID_VER_ACC_1_METER = 6,
3155}
3156impl MavOdidVerAcc {
3157 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3158}
3159impl Default for MavOdidVerAcc {
3160 fn default() -> Self {
3161 Self::DEFAULT
3162 }
3163}
3164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3166#[cfg_attr(feature = "serde", serde(tag = "type"))]
3167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3168#[repr(u32)]
3169#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3170pub enum MavParamExtType {
3171 #[doc = "8-bit unsigned integer"]
3172 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3173 #[doc = "8-bit signed integer"]
3174 MAV_PARAM_EXT_TYPE_INT8 = 2,
3175 #[doc = "16-bit unsigned integer"]
3176 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3177 #[doc = "16-bit signed integer"]
3178 MAV_PARAM_EXT_TYPE_INT16 = 4,
3179 #[doc = "32-bit unsigned integer"]
3180 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3181 #[doc = "32-bit signed integer"]
3182 MAV_PARAM_EXT_TYPE_INT32 = 6,
3183 #[doc = "64-bit unsigned integer"]
3184 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3185 #[doc = "64-bit signed integer"]
3186 MAV_PARAM_EXT_TYPE_INT64 = 8,
3187 #[doc = "32-bit floating-point"]
3188 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3189 #[doc = "64-bit floating-point"]
3190 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3191 #[doc = "Custom Type"]
3192 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3193}
3194impl MavParamExtType {
3195 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3196}
3197impl Default for MavParamExtType {
3198 fn default() -> Self {
3199 Self::DEFAULT
3200 }
3201}
3202#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3204#[cfg_attr(feature = "serde", serde(tag = "type"))]
3205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3206#[repr(u32)]
3207#[doc = "Specifies the datatype of a MAVLink parameter."]
3208pub enum MavParamType {
3209 #[doc = "8-bit unsigned integer"]
3210 MAV_PARAM_TYPE_UINT8 = 1,
3211 #[doc = "8-bit signed integer"]
3212 MAV_PARAM_TYPE_INT8 = 2,
3213 #[doc = "16-bit unsigned integer"]
3214 MAV_PARAM_TYPE_UINT16 = 3,
3215 #[doc = "16-bit signed integer"]
3216 MAV_PARAM_TYPE_INT16 = 4,
3217 #[doc = "32-bit unsigned integer"]
3218 MAV_PARAM_TYPE_UINT32 = 5,
3219 #[doc = "32-bit signed integer"]
3220 MAV_PARAM_TYPE_INT32 = 6,
3221 #[doc = "64-bit unsigned integer"]
3222 MAV_PARAM_TYPE_UINT64 = 7,
3223 #[doc = "64-bit signed integer"]
3224 MAV_PARAM_TYPE_INT64 = 8,
3225 #[doc = "32-bit floating-point"]
3226 MAV_PARAM_TYPE_REAL32 = 9,
3227 #[doc = "64-bit floating-point"]
3228 MAV_PARAM_TYPE_REAL64 = 10,
3229}
3230impl MavParamType {
3231 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3232}
3233impl Default for MavParamType {
3234 fn default() -> Self {
3235 Self::DEFAULT
3236 }
3237}
3238bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3239impl MavPowerStatus {
3240 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3241}
3242impl Default for MavPowerStatus {
3243 fn default() -> Self {
3244 Self::DEFAULT
3245 }
3246}
3247bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3248impl MavProtocolCapability {
3249 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3250}
3251impl Default for MavProtocolCapability {
3252 fn default() -> Self {
3253 Self::DEFAULT
3254 }
3255}
3256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3258#[cfg_attr(feature = "serde", serde(tag = "type"))]
3259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3260#[repr(u32)]
3261#[doc = "Result from a MAVLink command (MAV_CMD)"]
3262pub enum MavResult {
3263 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3264 MAV_RESULT_ACCEPTED = 0,
3265 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3266 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3267 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3268 MAV_RESULT_DENIED = 2,
3269 #[doc = "Command is not supported (unknown)."]
3270 MAV_RESULT_UNSUPPORTED = 3,
3271 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3272 MAV_RESULT_FAILED = 4,
3273 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3274 MAV_RESULT_IN_PROGRESS = 5,
3275 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3276 MAV_RESULT_CANCELLED = 6,
3277 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3278 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3279 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3280 MAV_RESULT_COMMAND_INT_ONLY = 8,
3281 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3282 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3283}
3284impl MavResult {
3285 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3286}
3287impl Default for MavResult {
3288 fn default() -> Self {
3289 Self::DEFAULT
3290 }
3291}
3292#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3294#[cfg_attr(feature = "serde", serde(tag = "type"))]
3295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3296#[repr(u32)]
3297#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3298#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3299pub enum MavRoi {
3300 #[doc = "No region of interest."]
3301 MAV_ROI_NONE = 0,
3302 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3303 MAV_ROI_WPNEXT = 1,
3304 #[doc = "Point toward given waypoint."]
3305 MAV_ROI_WPINDEX = 2,
3306 #[doc = "Point toward fixed location."]
3307 MAV_ROI_LOCATION = 3,
3308 #[doc = "Point toward of given id."]
3309 MAV_ROI_TARGET = 4,
3310}
3311impl MavRoi {
3312 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3313}
3314impl Default for MavRoi {
3315 fn default() -> Self {
3316 Self::DEFAULT
3317 }
3318}
3319#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3321#[cfg_attr(feature = "serde", serde(tag = "type"))]
3322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3323#[repr(u32)]
3324#[doc = "Enumeration of sensor orientation, according to its rotations"]
3325pub enum MavSensorOrientation {
3326 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3327 MAV_SENSOR_ROTATION_NONE = 0,
3328 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3329 MAV_SENSOR_ROTATION_YAW_45 = 1,
3330 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3331 MAV_SENSOR_ROTATION_YAW_90 = 2,
3332 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3333 MAV_SENSOR_ROTATION_YAW_135 = 3,
3334 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3335 MAV_SENSOR_ROTATION_YAW_180 = 4,
3336 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3337 MAV_SENSOR_ROTATION_YAW_225 = 5,
3338 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3339 MAV_SENSOR_ROTATION_YAW_270 = 6,
3340 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3341 MAV_SENSOR_ROTATION_YAW_315 = 7,
3342 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3343 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3344 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3345 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3346 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3347 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3348 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3349 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3350 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3351 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3352 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3353 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3354 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3355 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3356 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3357 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3358 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3359 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3360 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3361 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3362 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3363 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3364 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3365 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3366 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3367 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3368 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3369 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3370 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3371 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3372 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3373 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3374 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3375 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3376 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3377 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3378 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3379 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3380 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3381 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3382 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3384 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3385 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3386 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3387 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3388 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3389 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3390 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3391 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3392 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3393 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3394 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3395 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3396 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3397 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3398 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3399 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3400 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3401 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3402 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3403 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3404 #[doc = "Pitch: 315"]
3405 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3406 #[doc = "Roll: 90, Pitch: 315"]
3407 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3408 #[doc = "Custom orientation"]
3409 MAV_SENSOR_ROTATION_CUSTOM = 100,
3410}
3411impl MavSensorOrientation {
3412 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3413}
3414impl Default for MavSensorOrientation {
3415 fn default() -> Self {
3416 Self::DEFAULT
3417 }
3418}
3419#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3421#[cfg_attr(feature = "serde", serde(tag = "type"))]
3422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3423#[repr(u32)]
3424#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3425pub enum MavSeverity {
3426 #[doc = "System is unusable. This is a \"panic\" condition."]
3427 MAV_SEVERITY_EMERGENCY = 0,
3428 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3429 MAV_SEVERITY_ALERT = 1,
3430 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3431 MAV_SEVERITY_CRITICAL = 2,
3432 #[doc = "Indicates an error in secondary/redundant systems."]
3433 MAV_SEVERITY_ERROR = 3,
3434 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3435 MAV_SEVERITY_WARNING = 4,
3436 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3437 MAV_SEVERITY_NOTICE = 5,
3438 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3439 MAV_SEVERITY_INFO = 6,
3440 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3441 MAV_SEVERITY_DEBUG = 7,
3442}
3443impl MavSeverity {
3444 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3445}
3446impl Default for MavSeverity {
3447 fn default() -> Self {
3448 Self::DEFAULT
3449 }
3450}
3451#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3453#[cfg_attr(feature = "serde", serde(tag = "type"))]
3454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3455#[repr(u32)]
3456#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3457pub enum MavStandardMode {
3458 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3459 MAV_STANDARD_MODE_NON_STANDARD = 0,
3460 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3461 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3462 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3463 MAV_STANDARD_MODE_ORBIT = 2,
3464 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3465 MAV_STANDARD_MODE_CRUISE = 3,
3466 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3467 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3468 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3469 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3470 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3471 MAV_STANDARD_MODE_MISSION = 6,
3472 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3473 MAV_STANDARD_MODE_LAND = 7,
3474 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3475 MAV_STANDARD_MODE_TAKEOFF = 8,
3476}
3477impl MavStandardMode {
3478 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3479}
3480impl Default for MavStandardMode {
3481 fn default() -> Self {
3482 Self::DEFAULT
3483 }
3484}
3485#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3487#[cfg_attr(feature = "serde", serde(tag = "type"))]
3488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3489#[repr(u32)]
3490pub enum MavState {
3491 #[doc = "Uninitialized system, state is unknown."]
3492 MAV_STATE_UNINIT = 0,
3493 #[doc = "System is booting up."]
3494 MAV_STATE_BOOT = 1,
3495 #[doc = "System is calibrating and not flight-ready."]
3496 MAV_STATE_CALIBRATING = 2,
3497 #[doc = "System is grounded and on standby. It can be launched any time."]
3498 MAV_STATE_STANDBY = 3,
3499 #[doc = "System is active and might be already airborne. Motors are engaged."]
3500 MAV_STATE_ACTIVE = 4,
3501 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3502 MAV_STATE_CRITICAL = 5,
3503 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3504 MAV_STATE_EMERGENCY = 6,
3505 #[doc = "System just initialized its power-down sequence, will shut down now."]
3506 MAV_STATE_POWEROFF = 7,
3507 #[doc = "System is terminating itself (failsafe or commanded)."]
3508 MAV_STATE_FLIGHT_TERMINATION = 8,
3509}
3510impl MavState {
3511 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3512}
3513impl Default for MavState {
3514 fn default() -> Self {
3515 Self::DEFAULT
3516 }
3517}
3518bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3519impl MavSysStatusSensor {
3520 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3521}
3522impl Default for MavSysStatusSensor {
3523 fn default() -> Self {
3524 Self::DEFAULT
3525 }
3526}
3527bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3528impl MavSysStatusSensorExtended {
3529 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3530}
3531impl Default for MavSysStatusSensorExtended {
3532 fn default() -> Self {
3533 Self::DEFAULT
3534 }
3535}
3536#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3538#[cfg_attr(feature = "serde", serde(tag = "type"))]
3539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3540#[repr(u32)]
3541pub enum MavTunnelPayloadType {
3542 #[doc = "Encoding of payload unknown."]
3543 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3544 #[doc = "Registered for STorM32 gimbal controller."]
3545 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3546 #[doc = "Registered for STorM32 gimbal controller."]
3547 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3548 #[doc = "Registered for STorM32 gimbal controller."]
3549 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3550 #[doc = "Registered for STorM32 gimbal controller."]
3551 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3552 #[doc = "Registered for STorM32 gimbal controller."]
3553 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3554 #[doc = "Registered for STorM32 gimbal controller."]
3555 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3556 #[doc = "Registered for STorM32 gimbal controller."]
3557 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3558 #[doc = "Registered for STorM32 gimbal controller."]
3559 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3560 #[doc = "Registered for STorM32 gimbal controller."]
3561 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3562 #[doc = "Registered for STorM32 gimbal controller."]
3563 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3564 #[doc = "Registered for ModalAI remote OSD protocol."]
3565 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3566 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3567 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3568 #[doc = "Registered for ModalAI vendor use."]
3569 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3570}
3571impl MavTunnelPayloadType {
3572 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3573}
3574impl Default for MavTunnelPayloadType {
3575 fn default() -> Self {
3576 Self::DEFAULT
3577 }
3578}
3579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3581#[cfg_attr(feature = "serde", serde(tag = "type"))]
3582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3583#[repr(u32)]
3584#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3585pub enum MavType {
3586 #[doc = "Generic micro air vehicle"]
3587 MAV_TYPE_GENERIC = 0,
3588 #[doc = "Fixed wing aircraft."]
3589 MAV_TYPE_FIXED_WING = 1,
3590 #[doc = "Quadrotor"]
3591 MAV_TYPE_QUADROTOR = 2,
3592 #[doc = "Coaxial helicopter"]
3593 MAV_TYPE_COAXIAL = 3,
3594 #[doc = "Normal helicopter with tail rotor."]
3595 MAV_TYPE_HELICOPTER = 4,
3596 #[doc = "Ground installation"]
3597 MAV_TYPE_ANTENNA_TRACKER = 5,
3598 #[doc = "Operator control unit / ground control station"]
3599 MAV_TYPE_GCS = 6,
3600 #[doc = "Airship, controlled"]
3601 MAV_TYPE_AIRSHIP = 7,
3602 #[doc = "Free balloon, uncontrolled"]
3603 MAV_TYPE_FREE_BALLOON = 8,
3604 #[doc = "Rocket"]
3605 MAV_TYPE_ROCKET = 9,
3606 #[doc = "Ground rover"]
3607 MAV_TYPE_GROUND_ROVER = 10,
3608 #[doc = "Surface vessel, boat, ship"]
3609 MAV_TYPE_SURFACE_BOAT = 11,
3610 #[doc = "Submarine"]
3611 MAV_TYPE_SUBMARINE = 12,
3612 #[doc = "Hexarotor"]
3613 MAV_TYPE_HEXAROTOR = 13,
3614 #[doc = "Octorotor"]
3615 MAV_TYPE_OCTOROTOR = 14,
3616 #[doc = "Tricopter"]
3617 MAV_TYPE_TRICOPTER = 15,
3618 #[doc = "Flapping wing"]
3619 MAV_TYPE_FLAPPING_WING = 16,
3620 #[doc = "Kite"]
3621 MAV_TYPE_KITE = 17,
3622 #[doc = "Onboard companion controller"]
3623 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3624 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3625 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3626 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3627 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3628 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3629 MAV_TYPE_VTOL_TILTROTOR = 21,
3630 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3631 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3632 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3633 MAV_TYPE_VTOL_TAILSITTER = 23,
3634 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3635 MAV_TYPE_VTOL_TILTWING = 24,
3636 #[doc = "VTOL reserved 5"]
3637 MAV_TYPE_VTOL_RESERVED5 = 25,
3638 #[doc = "Gimbal"]
3639 MAV_TYPE_GIMBAL = 26,
3640 #[doc = "ADSB system"]
3641 MAV_TYPE_ADSB = 27,
3642 #[doc = "Steerable, nonrigid airfoil"]
3643 MAV_TYPE_PARAFOIL = 28,
3644 #[doc = "Dodecarotor"]
3645 MAV_TYPE_DODECAROTOR = 29,
3646 #[doc = "Camera"]
3647 MAV_TYPE_CAMERA = 30,
3648 #[doc = "Charging station"]
3649 MAV_TYPE_CHARGING_STATION = 31,
3650 #[doc = "FLARM collision avoidance system"]
3651 MAV_TYPE_FLARM = 32,
3652 #[doc = "Servo"]
3653 MAV_TYPE_SERVO = 33,
3654 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3655 MAV_TYPE_ODID = 34,
3656 #[doc = "Decarotor"]
3657 MAV_TYPE_DECAROTOR = 35,
3658 #[doc = "Battery"]
3659 MAV_TYPE_BATTERY = 36,
3660 #[doc = "Parachute"]
3661 MAV_TYPE_PARACHUTE = 37,
3662 #[doc = "Log"]
3663 MAV_TYPE_LOG = 38,
3664 #[doc = "OSD"]
3665 MAV_TYPE_OSD = 39,
3666 #[doc = "IMU"]
3667 MAV_TYPE_IMU = 40,
3668 #[doc = "GPS"]
3669 MAV_TYPE_GPS = 41,
3670 #[doc = "Winch"]
3671 MAV_TYPE_WINCH = 42,
3672 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3673 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3674 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3675 MAV_TYPE_ILLUMINATOR = 44,
3676 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3677 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3678}
3679impl MavType {
3680 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3681}
3682impl Default for MavType {
3683 fn default() -> Self {
3684 Self::DEFAULT
3685 }
3686}
3687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3689#[cfg_attr(feature = "serde", serde(tag = "type"))]
3690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3691#[repr(u32)]
3692#[doc = "Enumeration of VTOL states"]
3693pub enum MavVtolState {
3694 #[doc = "MAV is not configured as VTOL"]
3695 MAV_VTOL_STATE_UNDEFINED = 0,
3696 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3697 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3698 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3699 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3700 #[doc = "VTOL is in multicopter state"]
3701 MAV_VTOL_STATE_MC = 3,
3702 #[doc = "VTOL is in fixed-wing state"]
3703 MAV_VTOL_STATE_FW = 4,
3704}
3705impl MavVtolState {
3706 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3707}
3708impl Default for MavVtolState {
3709 fn default() -> Self {
3710 Self::DEFAULT
3711 }
3712}
3713bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3714impl MavWinchStatusFlag {
3715 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3716}
3717impl Default for MavWinchStatusFlag {
3718 fn default() -> Self {
3719 Self::DEFAULT
3720 }
3721}
3722#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3724#[cfg_attr(feature = "serde", serde(tag = "type"))]
3725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3726#[repr(u32)]
3727pub enum MavlinkDataStreamType {
3728 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3729 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3730 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3731 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3732 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3733 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3734}
3735impl MavlinkDataStreamType {
3736 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3737}
3738impl Default for MavlinkDataStreamType {
3739 fn default() -> Self {
3740 Self::DEFAULT
3741 }
3742}
3743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3745#[cfg_attr(feature = "serde", serde(tag = "type"))]
3746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3747#[repr(u32)]
3748#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3749pub enum MissionState {
3750 #[doc = "The mission status reporting is not supported."]
3751 MISSION_STATE_UNKNOWN = 0,
3752 #[doc = "No mission on the vehicle."]
3753 MISSION_STATE_NO_MISSION = 1,
3754 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3755 MISSION_STATE_NOT_STARTED = 2,
3756 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3757 MISSION_STATE_ACTIVE = 3,
3758 #[doc = "Mission is paused when in auto mode."]
3759 MISSION_STATE_PAUSED = 4,
3760 #[doc = "Mission has executed all mission items."]
3761 MISSION_STATE_COMPLETE = 5,
3762}
3763impl MissionState {
3764 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3765}
3766impl Default for MissionState {
3767 fn default() -> Self {
3768 Self::DEFAULT
3769 }
3770}
3771#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3773#[cfg_attr(feature = "serde", serde(tag = "type"))]
3774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3775#[repr(u32)]
3776#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3777pub enum MotorTestOrder {
3778 #[doc = "Default autopilot motor test method."]
3779 MOTOR_TEST_ORDER_DEFAULT = 0,
3780 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3781 MOTOR_TEST_ORDER_SEQUENCE = 1,
3782 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3783 MOTOR_TEST_ORDER_BOARD = 2,
3784}
3785impl MotorTestOrder {
3786 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3787}
3788impl Default for MotorTestOrder {
3789 fn default() -> Self {
3790 Self::DEFAULT
3791 }
3792}
3793#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3795#[cfg_attr(feature = "serde", serde(tag = "type"))]
3796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3797#[repr(u32)]
3798#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3799pub enum MotorTestThrottleType {
3800 #[doc = "Throttle as a percentage (0 ~ 100)"]
3801 MOTOR_TEST_THROTTLE_PERCENT = 0,
3802 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3803 MOTOR_TEST_THROTTLE_PWM = 1,
3804 #[doc = "Throttle pass-through from pilot's transmitter."]
3805 MOTOR_TEST_THROTTLE_PILOT = 2,
3806 #[doc = "Per-motor compass calibration test."]
3807 MOTOR_TEST_COMPASS_CAL = 3,
3808}
3809impl MotorTestThrottleType {
3810 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3811}
3812impl Default for MotorTestThrottleType {
3813 fn default() -> Self {
3814 Self::DEFAULT
3815 }
3816}
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822pub enum NavVtolLandOptions {
3823 #[doc = "Default autopilot landing behaviour."]
3824 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3825 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3826 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3827 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3828 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3829}
3830impl NavVtolLandOptions {
3831 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3832}
3833impl Default for NavVtolLandOptions {
3834 fn default() -> Self {
3835 Self::DEFAULT
3836 }
3837}
3838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3840#[cfg_attr(feature = "serde", serde(tag = "type"))]
3841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3842#[repr(u32)]
3843#[doc = "Yaw behaviour during orbit flight."]
3844pub enum OrbitYawBehaviour {
3845 #[doc = "Vehicle front points to the center (default)."]
3846 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3847 #[doc = "Vehicle front holds heading when message received."]
3848 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3849 #[doc = "Yaw uncontrolled."]
3850 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3851 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3852 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3853 #[doc = "Yaw controlled by RC input."]
3854 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3855 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3856 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3857}
3858impl OrbitYawBehaviour {
3859 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3860}
3861impl Default for OrbitYawBehaviour {
3862 fn default() -> Self {
3863 Self::DEFAULT
3864 }
3865}
3866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3868#[cfg_attr(feature = "serde", serde(tag = "type"))]
3869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3870#[repr(u32)]
3871#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3872pub enum ParachuteAction {
3873 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3874 PARACHUTE_DISABLE = 0,
3875 #[doc = "Enable auto-release of parachute."]
3876 PARACHUTE_ENABLE = 1,
3877 #[doc = "Release parachute and kill motors."]
3878 PARACHUTE_RELEASE = 2,
3879}
3880impl ParachuteAction {
3881 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3882}
3883impl Default for ParachuteAction {
3884 fn default() -> Self {
3885 Self::DEFAULT
3886 }
3887}
3888#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3890#[cfg_attr(feature = "serde", serde(tag = "type"))]
3891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3892#[repr(u32)]
3893#[doc = "Result from PARAM_EXT_SET message."]
3894pub enum ParamAck {
3895 #[doc = "Parameter value ACCEPTED and SET"]
3896 PARAM_ACK_ACCEPTED = 0,
3897 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3898 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3899 #[doc = "Parameter failed to set"]
3900 PARAM_ACK_FAILED = 2,
3901 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3902 PARAM_ACK_IN_PROGRESS = 3,
3903}
3904impl ParamAck {
3905 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3906}
3907impl Default for ParamAck {
3908 fn default() -> Self {
3909 Self::DEFAULT
3910 }
3911}
3912bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3913impl PositionTargetTypemask {
3914 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3915}
3916impl Default for PositionTargetTypemask {
3917 fn default() -> Self {
3918 Self::DEFAULT
3919 }
3920}
3921#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3923#[cfg_attr(feature = "serde", serde(tag = "type"))]
3924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3925#[repr(u32)]
3926#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3927pub enum PrecisionLandMode {
3928 #[doc = "Normal (non-precision) landing."]
3929 PRECISION_LAND_MODE_DISABLED = 0,
3930 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3931 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3932 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3933 PRECISION_LAND_MODE_REQUIRED = 2,
3934}
3935impl PrecisionLandMode {
3936 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3937}
3938impl Default for PrecisionLandMode {
3939 fn default() -> Self {
3940 Self::DEFAULT
3941 }
3942}
3943#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3944#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3945#[cfg_attr(feature = "serde", serde(tag = "type"))]
3946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3947#[repr(u32)]
3948#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3949pub enum PreflightStorageMissionAction {
3950 #[doc = "Read current mission data from persistent storage"]
3951 MISSION_READ_PERSISTENT = 0,
3952 #[doc = "Write current mission data to persistent storage"]
3953 MISSION_WRITE_PERSISTENT = 1,
3954 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3955 MISSION_RESET_DEFAULT = 2,
3956}
3957impl PreflightStorageMissionAction {
3958 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3959}
3960impl Default for PreflightStorageMissionAction {
3961 fn default() -> Self {
3962 Self::DEFAULT
3963 }
3964}
3965#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3967#[cfg_attr(feature = "serde", serde(tag = "type"))]
3968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3969#[repr(u32)]
3970#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3971pub enum PreflightStorageParameterAction {
3972 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3973 PARAM_READ_PERSISTENT = 0,
3974 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3975 PARAM_WRITE_PERSISTENT = 1,
3976 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3977 PARAM_RESET_CONFIG_DEFAULT = 2,
3978 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3979 PARAM_RESET_SENSOR_DEFAULT = 3,
3980 #[doc = "Reset all parameters, including operation counters, to default values"]
3981 PARAM_RESET_ALL_DEFAULT = 4,
3982}
3983impl PreflightStorageParameterAction {
3984 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3985}
3986impl Default for PreflightStorageParameterAction {
3987 fn default() -> Self {
3988 Self::DEFAULT
3989 }
3990}
3991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3993#[cfg_attr(feature = "serde", serde(tag = "type"))]
3994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3995#[repr(u32)]
3996#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3997pub enum RcSubType {
3998 #[doc = "Spektrum DSM2"]
3999 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4000 #[doc = "Spektrum DSMX"]
4001 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4002 #[doc = "Spektrum DSMX8"]
4003 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4004}
4005impl RcSubType {
4006 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4007}
4008impl Default for RcSubType {
4009 fn default() -> Self {
4010 Self::DEFAULT
4011 }
4012}
4013#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4015#[cfg_attr(feature = "serde", serde(tag = "type"))]
4016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4017#[repr(u32)]
4018#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4019pub enum RcType {
4020 #[doc = "Spektrum"]
4021 RC_TYPE_SPEKTRUM = 0,
4022 #[doc = "CRSF"]
4023 RC_TYPE_CRSF = 1,
4024}
4025impl RcType {
4026 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4027}
4028impl Default for RcType {
4029 fn default() -> Self {
4030 Self::DEFAULT
4031 }
4032}
4033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4035#[cfg_attr(feature = "serde", serde(tag = "type"))]
4036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4037#[repr(u32)]
4038#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4039pub enum RebootShutdownConditions {
4040 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4041 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4042 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4043 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4044}
4045impl RebootShutdownConditions {
4046 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4047}
4048impl Default for RebootShutdownConditions {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4055#[cfg_attr(feature = "serde", serde(tag = "type"))]
4056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4057#[repr(u32)]
4058#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4059pub enum RtkBaselineCoordinateSystem {
4060 #[doc = "Earth-centered, Earth-fixed"]
4061 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4062 #[doc = "RTK basestation centered, north, east, down"]
4063 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4064}
4065impl RtkBaselineCoordinateSystem {
4066 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4067}
4068impl Default for RtkBaselineCoordinateSystem {
4069 fn default() -> Self {
4070 Self::DEFAULT
4071 }
4072}
4073#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4075#[cfg_attr(feature = "serde", serde(tag = "type"))]
4076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4077#[repr(u32)]
4078#[doc = "Possible safety switch states."]
4079pub enum SafetySwitchState {
4080 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4081 SAFETY_SWITCH_STATE_SAFE = 0,
4082 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4083 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4084}
4085impl SafetySwitchState {
4086 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4087}
4088impl Default for SafetySwitchState {
4089 fn default() -> Self {
4090 Self::DEFAULT
4091 }
4092}
4093#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4095#[cfg_attr(feature = "serde", serde(tag = "type"))]
4096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4097#[repr(u32)]
4098#[doc = "SERIAL_CONTROL device types"]
4099pub enum SerialControlDev {
4100 #[doc = "First telemetry port"]
4101 SERIAL_CONTROL_DEV_TELEM1 = 0,
4102 #[doc = "Second telemetry port"]
4103 SERIAL_CONTROL_DEV_TELEM2 = 1,
4104 #[doc = "First GPS port"]
4105 SERIAL_CONTROL_DEV_GPS1 = 2,
4106 #[doc = "Second GPS port"]
4107 SERIAL_CONTROL_DEV_GPS2 = 3,
4108 #[doc = "system shell"]
4109 SERIAL_CONTROL_DEV_SHELL = 10,
4110 #[doc = "SERIAL0"]
4111 SERIAL_CONTROL_SERIAL0 = 100,
4112 #[doc = "SERIAL1"]
4113 SERIAL_CONTROL_SERIAL1 = 101,
4114 #[doc = "SERIAL2"]
4115 SERIAL_CONTROL_SERIAL2 = 102,
4116 #[doc = "SERIAL3"]
4117 SERIAL_CONTROL_SERIAL3 = 103,
4118 #[doc = "SERIAL4"]
4119 SERIAL_CONTROL_SERIAL4 = 104,
4120 #[doc = "SERIAL5"]
4121 SERIAL_CONTROL_SERIAL5 = 105,
4122 #[doc = "SERIAL6"]
4123 SERIAL_CONTROL_SERIAL6 = 106,
4124 #[doc = "SERIAL7"]
4125 SERIAL_CONTROL_SERIAL7 = 107,
4126 #[doc = "SERIAL8"]
4127 SERIAL_CONTROL_SERIAL8 = 108,
4128 #[doc = "SERIAL9"]
4129 SERIAL_CONTROL_SERIAL9 = 109,
4130}
4131impl SerialControlDev {
4132 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4133}
4134impl Default for SerialControlDev {
4135 fn default() -> Self {
4136 Self::DEFAULT
4137 }
4138}
4139bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4140impl SerialControlFlag {
4141 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4142}
4143impl Default for SerialControlFlag {
4144 fn default() -> Self {
4145 Self::DEFAULT
4146 }
4147}
4148#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4150#[cfg_attr(feature = "serde", serde(tag = "type"))]
4151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4152#[repr(u32)]
4153#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4154pub enum SetFocusType {
4155 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4156 FOCUS_TYPE_STEP = 0,
4157 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4158 FOCUS_TYPE_CONTINUOUS = 1,
4159 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4160 FOCUS_TYPE_RANGE = 2,
4161 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4162 FOCUS_TYPE_METERS = 3,
4163 #[doc = "Focus automatically."]
4164 FOCUS_TYPE_AUTO = 4,
4165 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4166 FOCUS_TYPE_AUTO_SINGLE = 5,
4167 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4168 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4169}
4170impl SetFocusType {
4171 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4172}
4173impl Default for SetFocusType {
4174 fn default() -> Self {
4175 Self::DEFAULT
4176 }
4177}
4178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4180#[cfg_attr(feature = "serde", serde(tag = "type"))]
4181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4182#[repr(u32)]
4183#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4184pub enum SpeedType {
4185 #[doc = "Airspeed"]
4186 SPEED_TYPE_AIRSPEED = 0,
4187 #[doc = "Groundspeed"]
4188 SPEED_TYPE_GROUNDSPEED = 1,
4189 #[doc = "Climb speed"]
4190 SPEED_TYPE_CLIMB_SPEED = 2,
4191 #[doc = "Descent speed"]
4192 SPEED_TYPE_DESCENT_SPEED = 3,
4193}
4194impl SpeedType {
4195 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4196}
4197impl Default for SpeedType {
4198 fn default() -> Self {
4199 Self::DEFAULT
4200 }
4201}
4202#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4204#[cfg_attr(feature = "serde", serde(tag = "type"))]
4205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4206#[repr(u32)]
4207#[doc = "Flags to indicate the status of camera storage."]
4208pub enum StorageStatus {
4209 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4210 STORAGE_STATUS_EMPTY = 0,
4211 #[doc = "Storage present but unformatted."]
4212 STORAGE_STATUS_UNFORMATTED = 1,
4213 #[doc = "Storage present and ready."]
4214 STORAGE_STATUS_READY = 2,
4215 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4216 STORAGE_STATUS_NOT_SUPPORTED = 3,
4217}
4218impl StorageStatus {
4219 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4220}
4221impl Default for StorageStatus {
4222 fn default() -> Self {
4223 Self::DEFAULT
4224 }
4225}
4226#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4227#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4228#[cfg_attr(feature = "serde", serde(tag = "type"))]
4229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4230#[repr(u32)]
4231#[doc = "Flags to indicate the type of storage."]
4232pub enum StorageType {
4233 #[doc = "Storage type is not known."]
4234 STORAGE_TYPE_UNKNOWN = 0,
4235 #[doc = "Storage type is USB device."]
4236 STORAGE_TYPE_USB_STICK = 1,
4237 #[doc = "Storage type is SD card."]
4238 STORAGE_TYPE_SD = 2,
4239 #[doc = "Storage type is microSD card."]
4240 STORAGE_TYPE_MICROSD = 3,
4241 #[doc = "Storage type is CFast."]
4242 STORAGE_TYPE_CF = 4,
4243 #[doc = "Storage type is CFexpress."]
4244 STORAGE_TYPE_CFE = 5,
4245 #[doc = "Storage type is XQD."]
4246 STORAGE_TYPE_XQD = 6,
4247 #[doc = "Storage type is HD mass storage type."]
4248 STORAGE_TYPE_HD = 7,
4249 #[doc = "Storage type is other, not listed type."]
4250 STORAGE_TYPE_OTHER = 254,
4251}
4252impl StorageType {
4253 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4254}
4255impl Default for StorageType {
4256 fn default() -> Self {
4257 Self::DEFAULT
4258 }
4259}
4260bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4261impl StorageUsageFlag {
4262 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4263}
4264impl Default for StorageUsageFlag {
4265 fn default() -> Self {
4266 Self::DEFAULT
4267 }
4268}
4269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4271#[cfg_attr(feature = "serde", serde(tag = "type"))]
4272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4273#[repr(u32)]
4274#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4275pub enum TuneFormat {
4276 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4277 TUNE_FORMAT_QBASIC1_1 = 1,
4278 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4279 TUNE_FORMAT_MML_MODERN = 2,
4280}
4281impl TuneFormat {
4282 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4283}
4284impl Default for TuneFormat {
4285 fn default() -> Self {
4286 Self::DEFAULT
4287 }
4288}
4289#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4291#[cfg_attr(feature = "serde", serde(tag = "type"))]
4292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4293#[repr(u32)]
4294#[doc = "Generalized UAVCAN node health"]
4295pub enum UavcanNodeHealth {
4296 #[doc = "The node is functioning properly."]
4297 UAVCAN_NODE_HEALTH_OK = 0,
4298 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4299 UAVCAN_NODE_HEALTH_WARNING = 1,
4300 #[doc = "The node has encountered a major failure."]
4301 UAVCAN_NODE_HEALTH_ERROR = 2,
4302 #[doc = "The node has suffered a fatal malfunction."]
4303 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4304}
4305impl UavcanNodeHealth {
4306 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4307}
4308impl Default for UavcanNodeHealth {
4309 fn default() -> Self {
4310 Self::DEFAULT
4311 }
4312}
4313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4315#[cfg_attr(feature = "serde", serde(tag = "type"))]
4316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4317#[repr(u32)]
4318#[doc = "Generalized UAVCAN node mode"]
4319pub enum UavcanNodeMode {
4320 #[doc = "The node is performing its primary functions."]
4321 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4322 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4323 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4324 #[doc = "The node is under maintenance."]
4325 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4326 #[doc = "The node is in the process of updating its software."]
4327 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4328 #[doc = "The node is no longer available online."]
4329 UAVCAN_NODE_MODE_OFFLINE = 7,
4330}
4331impl UavcanNodeMode {
4332 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4333}
4334impl Default for UavcanNodeMode {
4335 fn default() -> Self {
4336 Self::DEFAULT
4337 }
4338}
4339bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4340impl UtmDataAvailFlags {
4341 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4342}
4343impl Default for UtmDataAvailFlags {
4344 fn default() -> Self {
4345 Self::DEFAULT
4346 }
4347}
4348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4350#[cfg_attr(feature = "serde", serde(tag = "type"))]
4351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4352#[repr(u32)]
4353#[doc = "Airborne status of UAS."]
4354pub enum UtmFlightState {
4355 #[doc = "The flight state can't be determined."]
4356 UTM_FLIGHT_STATE_UNKNOWN = 1,
4357 #[doc = "UAS on ground."]
4358 UTM_FLIGHT_STATE_GROUND = 2,
4359 #[doc = "UAS airborne."]
4360 UTM_FLIGHT_STATE_AIRBORNE = 3,
4361 #[doc = "UAS is in an emergency flight state."]
4362 UTM_FLIGHT_STATE_EMERGENCY = 16,
4363 #[doc = "UAS has no active controls."]
4364 UTM_FLIGHT_STATE_NOCTRL = 32,
4365}
4366impl UtmFlightState {
4367 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4368}
4369impl Default for UtmFlightState {
4370 fn default() -> Self {
4371 Self::DEFAULT
4372 }
4373}
4374#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4376#[cfg_attr(feature = "serde", serde(tag = "type"))]
4377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4378#[repr(u32)]
4379#[doc = "Video stream encodings"]
4380pub enum VideoStreamEncoding {
4381 #[doc = "Stream encoding is unknown"]
4382 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4383 #[doc = "Stream encoding is H.264"]
4384 VIDEO_STREAM_ENCODING_H264 = 1,
4385 #[doc = "Stream encoding is H.265"]
4386 VIDEO_STREAM_ENCODING_H265 = 2,
4387}
4388impl VideoStreamEncoding {
4389 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4390}
4391impl Default for VideoStreamEncoding {
4392 fn default() -> Self {
4393 Self::DEFAULT
4394 }
4395}
4396bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4397impl VideoStreamStatusFlags {
4398 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4399}
4400impl Default for VideoStreamStatusFlags {
4401 fn default() -> Self {
4402 Self::DEFAULT
4403 }
4404}
4405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4407#[cfg_attr(feature = "serde", serde(tag = "type"))]
4408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4409#[repr(u32)]
4410#[doc = "Video stream types"]
4411pub enum VideoStreamType {
4412 #[doc = "Stream is RTSP"]
4413 VIDEO_STREAM_TYPE_RTSP = 0,
4414 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4415 VIDEO_STREAM_TYPE_RTPUDP = 1,
4416 #[doc = "Stream is MPEG on TCP"]
4417 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4418 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4419 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4420}
4421impl VideoStreamType {
4422 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4423}
4424impl Default for VideoStreamType {
4425 fn default() -> Self {
4426 Self::DEFAULT
4427 }
4428}
4429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4431#[cfg_attr(feature = "serde", serde(tag = "type"))]
4432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4433#[repr(u32)]
4434#[doc = "Direction of VTOL transition"]
4435pub enum VtolTransitionHeading {
4436 #[doc = "Respect the heading configuration of the vehicle."]
4437 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4438 #[doc = "Use the heading pointing towards the next waypoint."]
4439 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4440 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4441 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4442 #[doc = "Use the specified heading in parameter 4."]
4443 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4444 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4445 VTOL_TRANSITION_HEADING_ANY = 4,
4446}
4447impl VtolTransitionHeading {
4448 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4449}
4450impl Default for VtolTransitionHeading {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4457#[cfg_attr(feature = "serde", serde(tag = "type"))]
4458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4459#[repr(u32)]
4460#[doc = "WiFi Mode."]
4461pub enum WifiConfigApMode {
4462 #[doc = "WiFi mode is undefined."]
4463 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4464 #[doc = "WiFi configured as an access point."]
4465 WIFI_CONFIG_AP_MODE_AP = 1,
4466 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4467 WIFI_CONFIG_AP_MODE_STATION = 2,
4468 #[doc = "WiFi disabled."]
4469 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4470}
4471impl WifiConfigApMode {
4472 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4473}
4474impl Default for WifiConfigApMode {
4475 fn default() -> Self {
4476 Self::DEFAULT
4477 }
4478}
4479#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4481#[cfg_attr(feature = "serde", serde(tag = "type"))]
4482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4483#[repr(u32)]
4484#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4485pub enum WifiConfigApResponse {
4486 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4487 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4488 #[doc = "Changes accepted."]
4489 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4490 #[doc = "Changes rejected."]
4491 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4492 #[doc = "Invalid Mode."]
4493 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4494 #[doc = "Invalid SSID."]
4495 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4496 #[doc = "Invalid Password."]
4497 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4498}
4499impl WifiConfigApResponse {
4500 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4501}
4502impl Default for WifiConfigApResponse {
4503 fn default() -> Self {
4504 Self::DEFAULT
4505 }
4506}
4507#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4509#[cfg_attr(feature = "serde", serde(tag = "type"))]
4510#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4511#[repr(u32)]
4512#[doc = "Winch actions."]
4513pub enum WinchActions {
4514 #[doc = "Allow motor to freewheel."]
4515 WINCH_RELAXED = 0,
4516 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4517 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4518 #[doc = "Wind or unwind line at specified rate."]
4519 WINCH_RATE_CONTROL = 2,
4520 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4521 WINCH_LOCK = 3,
4522 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4523 WINCH_DELIVER = 4,
4524 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4525 WINCH_HOLD = 5,
4526 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4527 WINCH_RETRACT = 6,
4528 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4529 WINCH_LOAD_LINE = 7,
4530 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4531 WINCH_ABANDON_LINE = 8,
4532 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4533 WINCH_LOAD_PAYLOAD = 9,
4534}
4535impl WinchActions {
4536 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4537}
4538impl Default for WinchActions {
4539 fn default() -> Self {
4540 Self::DEFAULT
4541 }
4542}
4543#[doc = "id: 140"]
4544#[doc = "Set the vehicle attitude and body angular rates."]
4545#[derive(Debug, Clone, PartialEq)]
4546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4548pub struct ACTUATOR_CONTROL_TARGET_DATA {
4549 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4550 pub time_usec: u64,
4551 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4553 pub controls: [f32; 8],
4554 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4555 pub group_mlx: u8,
4556}
4557impl ACTUATOR_CONTROL_TARGET_DATA {
4558 pub const ENCODED_LEN: usize = 41usize;
4559 pub const DEFAULT: Self = Self {
4560 time_usec: 0_u64,
4561 controls: [0.0_f32; 8usize],
4562 group_mlx: 0_u8,
4563 };
4564 #[cfg(feature = "arbitrary")]
4565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4566 use arbitrary::{Arbitrary, Unstructured};
4567 let mut buf = [0u8; 1024];
4568 rng.fill_bytes(&mut buf);
4569 let mut unstructured = Unstructured::new(&buf);
4570 Self::arbitrary(&mut unstructured).unwrap_or_default()
4571 }
4572}
4573impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4574 fn default() -> Self {
4575 Self::DEFAULT.clone()
4576 }
4577}
4578impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4579 type Message = MavMessage;
4580 const ID: u32 = 140u32;
4581 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4582 const EXTRA_CRC: u8 = 181u8;
4583 const ENCODED_LEN: usize = 41usize;
4584 fn deser(
4585 _version: MavlinkVersion,
4586 __input: &[u8],
4587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4588 let avail_len = __input.len();
4589 let mut payload_buf = [0; Self::ENCODED_LEN];
4590 let mut buf = if avail_len < Self::ENCODED_LEN {
4591 payload_buf[0..avail_len].copy_from_slice(__input);
4592 Bytes::new(&payload_buf)
4593 } else {
4594 Bytes::new(__input)
4595 };
4596 let mut __struct = Self::default();
4597 __struct.time_usec = buf.get_u64_le();
4598 for v in &mut __struct.controls {
4599 let val = buf.get_f32_le();
4600 *v = val;
4601 }
4602 __struct.group_mlx = buf.get_u8();
4603 Ok(__struct)
4604 }
4605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4606 let mut __tmp = BytesMut::new(bytes);
4607 #[allow(clippy::absurd_extreme_comparisons)]
4608 #[allow(unused_comparisons)]
4609 if __tmp.remaining() < Self::ENCODED_LEN {
4610 panic!(
4611 "buffer is too small (need {} bytes, but got {})",
4612 Self::ENCODED_LEN,
4613 __tmp.remaining(),
4614 )
4615 }
4616 __tmp.put_u64_le(self.time_usec);
4617 for val in &self.controls {
4618 __tmp.put_f32_le(*val);
4619 }
4620 __tmp.put_u8(self.group_mlx);
4621 if matches!(version, MavlinkVersion::V2) {
4622 let len = __tmp.len();
4623 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4624 } else {
4625 __tmp.len()
4626 }
4627 }
4628}
4629#[doc = "id: 375"]
4630#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4631#[derive(Debug, Clone, PartialEq)]
4632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4633#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4634pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4635 #[doc = "Timestamp (since system boot)."]
4636 pub time_usec: u64,
4637 #[doc = "Active outputs"]
4638 pub active: u32,
4639 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4640 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4641 pub actuator: [f32; 32],
4642}
4643impl ACTUATOR_OUTPUT_STATUS_DATA {
4644 pub const ENCODED_LEN: usize = 140usize;
4645 pub const DEFAULT: Self = Self {
4646 time_usec: 0_u64,
4647 active: 0_u32,
4648 actuator: [0.0_f32; 32usize],
4649 };
4650 #[cfg(feature = "arbitrary")]
4651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4652 use arbitrary::{Arbitrary, Unstructured};
4653 let mut buf = [0u8; 1024];
4654 rng.fill_bytes(&mut buf);
4655 let mut unstructured = Unstructured::new(&buf);
4656 Self::arbitrary(&mut unstructured).unwrap_or_default()
4657 }
4658}
4659impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4660 fn default() -> Self {
4661 Self::DEFAULT.clone()
4662 }
4663}
4664impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4665 type Message = MavMessage;
4666 const ID: u32 = 375u32;
4667 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4668 const EXTRA_CRC: u8 = 251u8;
4669 const ENCODED_LEN: usize = 140usize;
4670 fn deser(
4671 _version: MavlinkVersion,
4672 __input: &[u8],
4673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4674 let avail_len = __input.len();
4675 let mut payload_buf = [0; Self::ENCODED_LEN];
4676 let mut buf = if avail_len < Self::ENCODED_LEN {
4677 payload_buf[0..avail_len].copy_from_slice(__input);
4678 Bytes::new(&payload_buf)
4679 } else {
4680 Bytes::new(__input)
4681 };
4682 let mut __struct = Self::default();
4683 __struct.time_usec = buf.get_u64_le();
4684 __struct.active = buf.get_u32_le();
4685 for v in &mut __struct.actuator {
4686 let val = buf.get_f32_le();
4687 *v = val;
4688 }
4689 Ok(__struct)
4690 }
4691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4692 let mut __tmp = BytesMut::new(bytes);
4693 #[allow(clippy::absurd_extreme_comparisons)]
4694 #[allow(unused_comparisons)]
4695 if __tmp.remaining() < Self::ENCODED_LEN {
4696 panic!(
4697 "buffer is too small (need {} bytes, but got {})",
4698 Self::ENCODED_LEN,
4699 __tmp.remaining(),
4700 )
4701 }
4702 __tmp.put_u64_le(self.time_usec);
4703 __tmp.put_u32_le(self.active);
4704 for val in &self.actuator {
4705 __tmp.put_f32_le(*val);
4706 }
4707 if matches!(version, MavlinkVersion::V2) {
4708 let len = __tmp.len();
4709 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4710 } else {
4711 __tmp.len()
4712 }
4713 }
4714}
4715#[doc = "id: 246"]
4716#[doc = "The location and information of an ADSB vehicle."]
4717#[derive(Debug, Clone, PartialEq)]
4718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4720pub struct ADSB_VEHICLE_DATA {
4721 #[doc = "ICAO address"]
4722 pub ICAO_address: u32,
4723 #[doc = "Latitude"]
4724 pub lat: i32,
4725 #[doc = "Longitude"]
4726 pub lon: i32,
4727 #[doc = "Altitude(ASL)"]
4728 pub altitude: i32,
4729 #[doc = "Course over ground"]
4730 pub heading: u16,
4731 #[doc = "The horizontal velocity"]
4732 pub hor_velocity: u16,
4733 #[doc = "The vertical velocity. Positive is up"]
4734 pub ver_velocity: i16,
4735 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4736 pub flags: AdsbFlags,
4737 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4738 pub squawk: u16,
4739 #[doc = "ADSB altitude type."]
4740 pub altitude_type: AdsbAltitudeType,
4741 #[doc = "The callsign, 8+null"]
4742 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4743 pub callsign: [u8; 9],
4744 #[doc = "ADSB emitter type."]
4745 pub emitter_type: AdsbEmitterType,
4746 #[doc = "Time since last communication in seconds"]
4747 pub tslc: u8,
4748}
4749impl ADSB_VEHICLE_DATA {
4750 pub const ENCODED_LEN: usize = 38usize;
4751 pub const DEFAULT: Self = Self {
4752 ICAO_address: 0_u32,
4753 lat: 0_i32,
4754 lon: 0_i32,
4755 altitude: 0_i32,
4756 heading: 0_u16,
4757 hor_velocity: 0_u16,
4758 ver_velocity: 0_i16,
4759 flags: AdsbFlags::DEFAULT,
4760 squawk: 0_u16,
4761 altitude_type: AdsbAltitudeType::DEFAULT,
4762 callsign: [0_u8; 9usize],
4763 emitter_type: AdsbEmitterType::DEFAULT,
4764 tslc: 0_u8,
4765 };
4766 #[cfg(feature = "arbitrary")]
4767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4768 use arbitrary::{Arbitrary, Unstructured};
4769 let mut buf = [0u8; 1024];
4770 rng.fill_bytes(&mut buf);
4771 let mut unstructured = Unstructured::new(&buf);
4772 Self::arbitrary(&mut unstructured).unwrap_or_default()
4773 }
4774}
4775impl Default for ADSB_VEHICLE_DATA {
4776 fn default() -> Self {
4777 Self::DEFAULT.clone()
4778 }
4779}
4780impl MessageData for ADSB_VEHICLE_DATA {
4781 type Message = MavMessage;
4782 const ID: u32 = 246u32;
4783 const NAME: &'static str = "ADSB_VEHICLE";
4784 const EXTRA_CRC: u8 = 184u8;
4785 const ENCODED_LEN: usize = 38usize;
4786 fn deser(
4787 _version: MavlinkVersion,
4788 __input: &[u8],
4789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4790 let avail_len = __input.len();
4791 let mut payload_buf = [0; Self::ENCODED_LEN];
4792 let mut buf = if avail_len < Self::ENCODED_LEN {
4793 payload_buf[0..avail_len].copy_from_slice(__input);
4794 Bytes::new(&payload_buf)
4795 } else {
4796 Bytes::new(__input)
4797 };
4798 let mut __struct = Self::default();
4799 __struct.ICAO_address = buf.get_u32_le();
4800 __struct.lat = buf.get_i32_le();
4801 __struct.lon = buf.get_i32_le();
4802 __struct.altitude = buf.get_i32_le();
4803 __struct.heading = buf.get_u16_le();
4804 __struct.hor_velocity = buf.get_u16_le();
4805 __struct.ver_velocity = buf.get_i16_le();
4806 let tmp = buf.get_u16_le();
4807 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4808 ::mavlink_core::error::ParserError::InvalidFlag {
4809 flag_type: "AdsbFlags",
4810 value: tmp as u32,
4811 },
4812 )?;
4813 __struct.squawk = buf.get_u16_le();
4814 let tmp = buf.get_u8();
4815 __struct.altitude_type =
4816 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4817 enum_type: "AdsbAltitudeType",
4818 value: tmp as u32,
4819 })?;
4820 for v in &mut __struct.callsign {
4821 let val = buf.get_u8();
4822 *v = val;
4823 }
4824 let tmp = buf.get_u8();
4825 __struct.emitter_type =
4826 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4827 enum_type: "AdsbEmitterType",
4828 value: tmp as u32,
4829 })?;
4830 __struct.tslc = buf.get_u8();
4831 Ok(__struct)
4832 }
4833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4834 let mut __tmp = BytesMut::new(bytes);
4835 #[allow(clippy::absurd_extreme_comparisons)]
4836 #[allow(unused_comparisons)]
4837 if __tmp.remaining() < Self::ENCODED_LEN {
4838 panic!(
4839 "buffer is too small (need {} bytes, but got {})",
4840 Self::ENCODED_LEN,
4841 __tmp.remaining(),
4842 )
4843 }
4844 __tmp.put_u32_le(self.ICAO_address);
4845 __tmp.put_i32_le(self.lat);
4846 __tmp.put_i32_le(self.lon);
4847 __tmp.put_i32_le(self.altitude);
4848 __tmp.put_u16_le(self.heading);
4849 __tmp.put_u16_le(self.hor_velocity);
4850 __tmp.put_i16_le(self.ver_velocity);
4851 __tmp.put_u16_le(self.flags.bits());
4852 __tmp.put_u16_le(self.squawk);
4853 __tmp.put_u8(self.altitude_type as u8);
4854 for val in &self.callsign {
4855 __tmp.put_u8(*val);
4856 }
4857 __tmp.put_u8(self.emitter_type as u8);
4858 __tmp.put_u8(self.tslc);
4859 if matches!(version, MavlinkVersion::V2) {
4860 let len = __tmp.len();
4861 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4862 } else {
4863 __tmp.len()
4864 }
4865 }
4866}
4867#[doc = "id: 301"]
4868#[doc = "The location and information of an AIS vessel."]
4869#[derive(Debug, Clone, PartialEq)]
4870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4872pub struct AIS_VESSEL_DATA {
4873 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4874 pub MMSI: u32,
4875 #[doc = "Latitude"]
4876 pub lat: i32,
4877 #[doc = "Longitude"]
4878 pub lon: i32,
4879 #[doc = "Course over ground"]
4880 pub COG: u16,
4881 #[doc = "True heading"]
4882 pub heading: u16,
4883 #[doc = "Speed over ground"]
4884 pub velocity: u16,
4885 #[doc = "Distance from lat/lon location to bow"]
4886 pub dimension_bow: u16,
4887 #[doc = "Distance from lat/lon location to stern"]
4888 pub dimension_stern: u16,
4889 #[doc = "Time since last communication in seconds"]
4890 pub tslc: u16,
4891 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4892 pub flags: AisFlags,
4893 #[doc = "Turn rate"]
4894 pub turn_rate: i8,
4895 #[doc = "Navigational status"]
4896 pub navigational_status: AisNavStatus,
4897 #[doc = "Type of vessels"]
4898 pub mavtype: AisType,
4899 #[doc = "Distance from lat/lon location to port side"]
4900 pub dimension_port: u8,
4901 #[doc = "Distance from lat/lon location to starboard side"]
4902 pub dimension_starboard: u8,
4903 #[doc = "The vessel callsign"]
4904 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4905 pub callsign: [u8; 7],
4906 #[doc = "The vessel name"]
4907 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4908 pub name: [u8; 20],
4909}
4910impl AIS_VESSEL_DATA {
4911 pub const ENCODED_LEN: usize = 58usize;
4912 pub const DEFAULT: Self = Self {
4913 MMSI: 0_u32,
4914 lat: 0_i32,
4915 lon: 0_i32,
4916 COG: 0_u16,
4917 heading: 0_u16,
4918 velocity: 0_u16,
4919 dimension_bow: 0_u16,
4920 dimension_stern: 0_u16,
4921 tslc: 0_u16,
4922 flags: AisFlags::DEFAULT,
4923 turn_rate: 0_i8,
4924 navigational_status: AisNavStatus::DEFAULT,
4925 mavtype: AisType::DEFAULT,
4926 dimension_port: 0_u8,
4927 dimension_starboard: 0_u8,
4928 callsign: [0_u8; 7usize],
4929 name: [0_u8; 20usize],
4930 };
4931 #[cfg(feature = "arbitrary")]
4932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4933 use arbitrary::{Arbitrary, Unstructured};
4934 let mut buf = [0u8; 1024];
4935 rng.fill_bytes(&mut buf);
4936 let mut unstructured = Unstructured::new(&buf);
4937 Self::arbitrary(&mut unstructured).unwrap_or_default()
4938 }
4939}
4940impl Default for AIS_VESSEL_DATA {
4941 fn default() -> Self {
4942 Self::DEFAULT.clone()
4943 }
4944}
4945impl MessageData for AIS_VESSEL_DATA {
4946 type Message = MavMessage;
4947 const ID: u32 = 301u32;
4948 const NAME: &'static str = "AIS_VESSEL";
4949 const EXTRA_CRC: u8 = 243u8;
4950 const ENCODED_LEN: usize = 58usize;
4951 fn deser(
4952 _version: MavlinkVersion,
4953 __input: &[u8],
4954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4955 let avail_len = __input.len();
4956 let mut payload_buf = [0; Self::ENCODED_LEN];
4957 let mut buf = if avail_len < Self::ENCODED_LEN {
4958 payload_buf[0..avail_len].copy_from_slice(__input);
4959 Bytes::new(&payload_buf)
4960 } else {
4961 Bytes::new(__input)
4962 };
4963 let mut __struct = Self::default();
4964 __struct.MMSI = buf.get_u32_le();
4965 __struct.lat = buf.get_i32_le();
4966 __struct.lon = buf.get_i32_le();
4967 __struct.COG = buf.get_u16_le();
4968 __struct.heading = buf.get_u16_le();
4969 __struct.velocity = buf.get_u16_le();
4970 __struct.dimension_bow = buf.get_u16_le();
4971 __struct.dimension_stern = buf.get_u16_le();
4972 __struct.tslc = buf.get_u16_le();
4973 let tmp = buf.get_u16_le();
4974 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4975 ::mavlink_core::error::ParserError::InvalidFlag {
4976 flag_type: "AisFlags",
4977 value: tmp as u32,
4978 },
4979 )?;
4980 __struct.turn_rate = buf.get_i8();
4981 let tmp = buf.get_u8();
4982 __struct.navigational_status =
4983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4984 enum_type: "AisNavStatus",
4985 value: tmp as u32,
4986 })?;
4987 let tmp = buf.get_u8();
4988 __struct.mavtype =
4989 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4990 enum_type: "AisType",
4991 value: tmp as u32,
4992 })?;
4993 __struct.dimension_port = buf.get_u8();
4994 __struct.dimension_starboard = buf.get_u8();
4995 for v in &mut __struct.callsign {
4996 let val = buf.get_u8();
4997 *v = val;
4998 }
4999 for v in &mut __struct.name {
5000 let val = buf.get_u8();
5001 *v = val;
5002 }
5003 Ok(__struct)
5004 }
5005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5006 let mut __tmp = BytesMut::new(bytes);
5007 #[allow(clippy::absurd_extreme_comparisons)]
5008 #[allow(unused_comparisons)]
5009 if __tmp.remaining() < Self::ENCODED_LEN {
5010 panic!(
5011 "buffer is too small (need {} bytes, but got {})",
5012 Self::ENCODED_LEN,
5013 __tmp.remaining(),
5014 )
5015 }
5016 __tmp.put_u32_le(self.MMSI);
5017 __tmp.put_i32_le(self.lat);
5018 __tmp.put_i32_le(self.lon);
5019 __tmp.put_u16_le(self.COG);
5020 __tmp.put_u16_le(self.heading);
5021 __tmp.put_u16_le(self.velocity);
5022 __tmp.put_u16_le(self.dimension_bow);
5023 __tmp.put_u16_le(self.dimension_stern);
5024 __tmp.put_u16_le(self.tslc);
5025 __tmp.put_u16_le(self.flags.bits());
5026 __tmp.put_i8(self.turn_rate);
5027 __tmp.put_u8(self.navigational_status as u8);
5028 __tmp.put_u8(self.mavtype as u8);
5029 __tmp.put_u8(self.dimension_port);
5030 __tmp.put_u8(self.dimension_starboard);
5031 for val in &self.callsign {
5032 __tmp.put_u8(*val);
5033 }
5034 for val in &self.name {
5035 __tmp.put_u8(*val);
5036 }
5037 if matches!(version, MavlinkVersion::V2) {
5038 let len = __tmp.len();
5039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5040 } else {
5041 __tmp.len()
5042 }
5043 }
5044}
5045#[doc = "id: 141"]
5046#[doc = "The current system altitude."]
5047#[derive(Debug, Clone, PartialEq)]
5048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5050pub struct ALTITUDE_DATA {
5051 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5052 pub time_usec: u64,
5053 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5054 pub altitude_monotonic: f32,
5055 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5056 pub altitude_amsl: f32,
5057 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5058 pub altitude_local: f32,
5059 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5060 pub altitude_relative: f32,
5061 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5062 pub altitude_terrain: f32,
5063 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5064 pub bottom_clearance: f32,
5065}
5066impl ALTITUDE_DATA {
5067 pub const ENCODED_LEN: usize = 32usize;
5068 pub const DEFAULT: Self = Self {
5069 time_usec: 0_u64,
5070 altitude_monotonic: 0.0_f32,
5071 altitude_amsl: 0.0_f32,
5072 altitude_local: 0.0_f32,
5073 altitude_relative: 0.0_f32,
5074 altitude_terrain: 0.0_f32,
5075 bottom_clearance: 0.0_f32,
5076 };
5077 #[cfg(feature = "arbitrary")]
5078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5079 use arbitrary::{Arbitrary, Unstructured};
5080 let mut buf = [0u8; 1024];
5081 rng.fill_bytes(&mut buf);
5082 let mut unstructured = Unstructured::new(&buf);
5083 Self::arbitrary(&mut unstructured).unwrap_or_default()
5084 }
5085}
5086impl Default for ALTITUDE_DATA {
5087 fn default() -> Self {
5088 Self::DEFAULT.clone()
5089 }
5090}
5091impl MessageData for ALTITUDE_DATA {
5092 type Message = MavMessage;
5093 const ID: u32 = 141u32;
5094 const NAME: &'static str = "ALTITUDE";
5095 const EXTRA_CRC: u8 = 47u8;
5096 const ENCODED_LEN: usize = 32usize;
5097 fn deser(
5098 _version: MavlinkVersion,
5099 __input: &[u8],
5100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5101 let avail_len = __input.len();
5102 let mut payload_buf = [0; Self::ENCODED_LEN];
5103 let mut buf = if avail_len < Self::ENCODED_LEN {
5104 payload_buf[0..avail_len].copy_from_slice(__input);
5105 Bytes::new(&payload_buf)
5106 } else {
5107 Bytes::new(__input)
5108 };
5109 let mut __struct = Self::default();
5110 __struct.time_usec = buf.get_u64_le();
5111 __struct.altitude_monotonic = buf.get_f32_le();
5112 __struct.altitude_amsl = buf.get_f32_le();
5113 __struct.altitude_local = buf.get_f32_le();
5114 __struct.altitude_relative = buf.get_f32_le();
5115 __struct.altitude_terrain = buf.get_f32_le();
5116 __struct.bottom_clearance = buf.get_f32_le();
5117 Ok(__struct)
5118 }
5119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5120 let mut __tmp = BytesMut::new(bytes);
5121 #[allow(clippy::absurd_extreme_comparisons)]
5122 #[allow(unused_comparisons)]
5123 if __tmp.remaining() < Self::ENCODED_LEN {
5124 panic!(
5125 "buffer is too small (need {} bytes, but got {})",
5126 Self::ENCODED_LEN,
5127 __tmp.remaining(),
5128 )
5129 }
5130 __tmp.put_u64_le(self.time_usec);
5131 __tmp.put_f32_le(self.altitude_monotonic);
5132 __tmp.put_f32_le(self.altitude_amsl);
5133 __tmp.put_f32_le(self.altitude_local);
5134 __tmp.put_f32_le(self.altitude_relative);
5135 __tmp.put_f32_le(self.altitude_terrain);
5136 __tmp.put_f32_le(self.bottom_clearance);
5137 if matches!(version, MavlinkVersion::V2) {
5138 let len = __tmp.len();
5139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5140 } else {
5141 __tmp.len()
5142 }
5143 }
5144}
5145#[doc = "id: 30"]
5146#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5147#[derive(Debug, Clone, PartialEq)]
5148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5150pub struct ATTITUDE_DATA {
5151 #[doc = "Timestamp (time since system boot)."]
5152 pub time_boot_ms: u32,
5153 #[doc = "Roll angle (-pi..+pi)"]
5154 pub roll: f32,
5155 #[doc = "Pitch angle (-pi..+pi)"]
5156 pub pitch: f32,
5157 #[doc = "Yaw angle (-pi..+pi)"]
5158 pub yaw: f32,
5159 #[doc = "Roll angular speed"]
5160 pub rollspeed: f32,
5161 #[doc = "Pitch angular speed"]
5162 pub pitchspeed: f32,
5163 #[doc = "Yaw angular speed"]
5164 pub yawspeed: f32,
5165}
5166impl ATTITUDE_DATA {
5167 pub const ENCODED_LEN: usize = 28usize;
5168 pub const DEFAULT: Self = Self {
5169 time_boot_ms: 0_u32,
5170 roll: 0.0_f32,
5171 pitch: 0.0_f32,
5172 yaw: 0.0_f32,
5173 rollspeed: 0.0_f32,
5174 pitchspeed: 0.0_f32,
5175 yawspeed: 0.0_f32,
5176 };
5177 #[cfg(feature = "arbitrary")]
5178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5179 use arbitrary::{Arbitrary, Unstructured};
5180 let mut buf = [0u8; 1024];
5181 rng.fill_bytes(&mut buf);
5182 let mut unstructured = Unstructured::new(&buf);
5183 Self::arbitrary(&mut unstructured).unwrap_or_default()
5184 }
5185}
5186impl Default for ATTITUDE_DATA {
5187 fn default() -> Self {
5188 Self::DEFAULT.clone()
5189 }
5190}
5191impl MessageData for ATTITUDE_DATA {
5192 type Message = MavMessage;
5193 const ID: u32 = 30u32;
5194 const NAME: &'static str = "ATTITUDE";
5195 const EXTRA_CRC: u8 = 39u8;
5196 const ENCODED_LEN: usize = 28usize;
5197 fn deser(
5198 _version: MavlinkVersion,
5199 __input: &[u8],
5200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5201 let avail_len = __input.len();
5202 let mut payload_buf = [0; Self::ENCODED_LEN];
5203 let mut buf = if avail_len < Self::ENCODED_LEN {
5204 payload_buf[0..avail_len].copy_from_slice(__input);
5205 Bytes::new(&payload_buf)
5206 } else {
5207 Bytes::new(__input)
5208 };
5209 let mut __struct = Self::default();
5210 __struct.time_boot_ms = buf.get_u32_le();
5211 __struct.roll = buf.get_f32_le();
5212 __struct.pitch = buf.get_f32_le();
5213 __struct.yaw = buf.get_f32_le();
5214 __struct.rollspeed = buf.get_f32_le();
5215 __struct.pitchspeed = buf.get_f32_le();
5216 __struct.yawspeed = buf.get_f32_le();
5217 Ok(__struct)
5218 }
5219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5220 let mut __tmp = BytesMut::new(bytes);
5221 #[allow(clippy::absurd_extreme_comparisons)]
5222 #[allow(unused_comparisons)]
5223 if __tmp.remaining() < Self::ENCODED_LEN {
5224 panic!(
5225 "buffer is too small (need {} bytes, but got {})",
5226 Self::ENCODED_LEN,
5227 __tmp.remaining(),
5228 )
5229 }
5230 __tmp.put_u32_le(self.time_boot_ms);
5231 __tmp.put_f32_le(self.roll);
5232 __tmp.put_f32_le(self.pitch);
5233 __tmp.put_f32_le(self.yaw);
5234 __tmp.put_f32_le(self.rollspeed);
5235 __tmp.put_f32_le(self.pitchspeed);
5236 __tmp.put_f32_le(self.yawspeed);
5237 if matches!(version, MavlinkVersion::V2) {
5238 let len = __tmp.len();
5239 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5240 } else {
5241 __tmp.len()
5242 }
5243 }
5244}
5245#[doc = "id: 31"]
5246#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5247#[derive(Debug, Clone, PartialEq)]
5248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5249#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5250pub struct ATTITUDE_QUATERNION_DATA {
5251 #[doc = "Timestamp (time since system boot)."]
5252 pub time_boot_ms: u32,
5253 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5254 pub q1: f32,
5255 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5256 pub q2: f32,
5257 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5258 pub q3: f32,
5259 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5260 pub q4: f32,
5261 #[doc = "Roll angular speed"]
5262 pub rollspeed: f32,
5263 #[doc = "Pitch angular speed"]
5264 pub pitchspeed: f32,
5265 #[doc = "Yaw angular speed"]
5266 pub yawspeed: f32,
5267 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5268 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5270 pub repr_offset_q: [f32; 4],
5271}
5272impl ATTITUDE_QUATERNION_DATA {
5273 pub const ENCODED_LEN: usize = 48usize;
5274 pub const DEFAULT: Self = Self {
5275 time_boot_ms: 0_u32,
5276 q1: 0.0_f32,
5277 q2: 0.0_f32,
5278 q3: 0.0_f32,
5279 q4: 0.0_f32,
5280 rollspeed: 0.0_f32,
5281 pitchspeed: 0.0_f32,
5282 yawspeed: 0.0_f32,
5283 repr_offset_q: [0.0_f32; 4usize],
5284 };
5285 #[cfg(feature = "arbitrary")]
5286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5287 use arbitrary::{Arbitrary, Unstructured};
5288 let mut buf = [0u8; 1024];
5289 rng.fill_bytes(&mut buf);
5290 let mut unstructured = Unstructured::new(&buf);
5291 Self::arbitrary(&mut unstructured).unwrap_or_default()
5292 }
5293}
5294impl Default for ATTITUDE_QUATERNION_DATA {
5295 fn default() -> Self {
5296 Self::DEFAULT.clone()
5297 }
5298}
5299impl MessageData for ATTITUDE_QUATERNION_DATA {
5300 type Message = MavMessage;
5301 const ID: u32 = 31u32;
5302 const NAME: &'static str = "ATTITUDE_QUATERNION";
5303 const EXTRA_CRC: u8 = 246u8;
5304 const ENCODED_LEN: usize = 48usize;
5305 fn deser(
5306 _version: MavlinkVersion,
5307 __input: &[u8],
5308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5309 let avail_len = __input.len();
5310 let mut payload_buf = [0; Self::ENCODED_LEN];
5311 let mut buf = if avail_len < Self::ENCODED_LEN {
5312 payload_buf[0..avail_len].copy_from_slice(__input);
5313 Bytes::new(&payload_buf)
5314 } else {
5315 Bytes::new(__input)
5316 };
5317 let mut __struct = Self::default();
5318 __struct.time_boot_ms = buf.get_u32_le();
5319 __struct.q1 = buf.get_f32_le();
5320 __struct.q2 = buf.get_f32_le();
5321 __struct.q3 = buf.get_f32_le();
5322 __struct.q4 = buf.get_f32_le();
5323 __struct.rollspeed = buf.get_f32_le();
5324 __struct.pitchspeed = buf.get_f32_le();
5325 __struct.yawspeed = buf.get_f32_le();
5326 for v in &mut __struct.repr_offset_q {
5327 let val = buf.get_f32_le();
5328 *v = val;
5329 }
5330 Ok(__struct)
5331 }
5332 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5333 let mut __tmp = BytesMut::new(bytes);
5334 #[allow(clippy::absurd_extreme_comparisons)]
5335 #[allow(unused_comparisons)]
5336 if __tmp.remaining() < Self::ENCODED_LEN {
5337 panic!(
5338 "buffer is too small (need {} bytes, but got {})",
5339 Self::ENCODED_LEN,
5340 __tmp.remaining(),
5341 )
5342 }
5343 __tmp.put_u32_le(self.time_boot_ms);
5344 __tmp.put_f32_le(self.q1);
5345 __tmp.put_f32_le(self.q2);
5346 __tmp.put_f32_le(self.q3);
5347 __tmp.put_f32_le(self.q4);
5348 __tmp.put_f32_le(self.rollspeed);
5349 __tmp.put_f32_le(self.pitchspeed);
5350 __tmp.put_f32_le(self.yawspeed);
5351 for val in &self.repr_offset_q {
5352 __tmp.put_f32_le(*val);
5353 }
5354 if matches!(version, MavlinkVersion::V2) {
5355 let len = __tmp.len();
5356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5357 } else {
5358 __tmp.len()
5359 }
5360 }
5361}
5362#[doc = "id: 61"]
5363#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5364#[derive(Debug, Clone, PartialEq)]
5365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5367pub struct ATTITUDE_QUATERNION_COV_DATA {
5368 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5369 pub time_usec: u64,
5370 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5372 pub q: [f32; 4],
5373 #[doc = "Roll angular speed"]
5374 pub rollspeed: f32,
5375 #[doc = "Pitch angular speed"]
5376 pub pitchspeed: f32,
5377 #[doc = "Yaw angular speed"]
5378 pub yawspeed: f32,
5379 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5380 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5381 pub covariance: [f32; 9],
5382}
5383impl ATTITUDE_QUATERNION_COV_DATA {
5384 pub const ENCODED_LEN: usize = 72usize;
5385 pub const DEFAULT: Self = Self {
5386 time_usec: 0_u64,
5387 q: [0.0_f32; 4usize],
5388 rollspeed: 0.0_f32,
5389 pitchspeed: 0.0_f32,
5390 yawspeed: 0.0_f32,
5391 covariance: [0.0_f32; 9usize],
5392 };
5393 #[cfg(feature = "arbitrary")]
5394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5395 use arbitrary::{Arbitrary, Unstructured};
5396 let mut buf = [0u8; 1024];
5397 rng.fill_bytes(&mut buf);
5398 let mut unstructured = Unstructured::new(&buf);
5399 Self::arbitrary(&mut unstructured).unwrap_or_default()
5400 }
5401}
5402impl Default for ATTITUDE_QUATERNION_COV_DATA {
5403 fn default() -> Self {
5404 Self::DEFAULT.clone()
5405 }
5406}
5407impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5408 type Message = MavMessage;
5409 const ID: u32 = 61u32;
5410 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5411 const EXTRA_CRC: u8 = 167u8;
5412 const ENCODED_LEN: usize = 72usize;
5413 fn deser(
5414 _version: MavlinkVersion,
5415 __input: &[u8],
5416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5417 let avail_len = __input.len();
5418 let mut payload_buf = [0; Self::ENCODED_LEN];
5419 let mut buf = if avail_len < Self::ENCODED_LEN {
5420 payload_buf[0..avail_len].copy_from_slice(__input);
5421 Bytes::new(&payload_buf)
5422 } else {
5423 Bytes::new(__input)
5424 };
5425 let mut __struct = Self::default();
5426 __struct.time_usec = buf.get_u64_le();
5427 for v in &mut __struct.q {
5428 let val = buf.get_f32_le();
5429 *v = val;
5430 }
5431 __struct.rollspeed = buf.get_f32_le();
5432 __struct.pitchspeed = buf.get_f32_le();
5433 __struct.yawspeed = buf.get_f32_le();
5434 for v in &mut __struct.covariance {
5435 let val = buf.get_f32_le();
5436 *v = val;
5437 }
5438 Ok(__struct)
5439 }
5440 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5441 let mut __tmp = BytesMut::new(bytes);
5442 #[allow(clippy::absurd_extreme_comparisons)]
5443 #[allow(unused_comparisons)]
5444 if __tmp.remaining() < Self::ENCODED_LEN {
5445 panic!(
5446 "buffer is too small (need {} bytes, but got {})",
5447 Self::ENCODED_LEN,
5448 __tmp.remaining(),
5449 )
5450 }
5451 __tmp.put_u64_le(self.time_usec);
5452 for val in &self.q {
5453 __tmp.put_f32_le(*val);
5454 }
5455 __tmp.put_f32_le(self.rollspeed);
5456 __tmp.put_f32_le(self.pitchspeed);
5457 __tmp.put_f32_le(self.yawspeed);
5458 for val in &self.covariance {
5459 __tmp.put_f32_le(*val);
5460 }
5461 if matches!(version, MavlinkVersion::V2) {
5462 let len = __tmp.len();
5463 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5464 } else {
5465 __tmp.len()
5466 }
5467 }
5468}
5469#[doc = "id: 83"]
5470#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5471#[derive(Debug, Clone, PartialEq)]
5472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5474pub struct ATTITUDE_TARGET_DATA {
5475 #[doc = "Timestamp (time since system boot)."]
5476 pub time_boot_ms: u32,
5477 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5479 pub q: [f32; 4],
5480 #[doc = "Body roll rate"]
5481 pub body_roll_rate: f32,
5482 #[doc = "Body pitch rate"]
5483 pub body_pitch_rate: f32,
5484 #[doc = "Body yaw rate"]
5485 pub body_yaw_rate: f32,
5486 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5487 pub thrust: f32,
5488 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5489 pub type_mask: AttitudeTargetTypemask,
5490}
5491impl ATTITUDE_TARGET_DATA {
5492 pub const ENCODED_LEN: usize = 37usize;
5493 pub const DEFAULT: Self = Self {
5494 time_boot_ms: 0_u32,
5495 q: [0.0_f32; 4usize],
5496 body_roll_rate: 0.0_f32,
5497 body_pitch_rate: 0.0_f32,
5498 body_yaw_rate: 0.0_f32,
5499 thrust: 0.0_f32,
5500 type_mask: AttitudeTargetTypemask::DEFAULT,
5501 };
5502 #[cfg(feature = "arbitrary")]
5503 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5504 use arbitrary::{Arbitrary, Unstructured};
5505 let mut buf = [0u8; 1024];
5506 rng.fill_bytes(&mut buf);
5507 let mut unstructured = Unstructured::new(&buf);
5508 Self::arbitrary(&mut unstructured).unwrap_or_default()
5509 }
5510}
5511impl Default for ATTITUDE_TARGET_DATA {
5512 fn default() -> Self {
5513 Self::DEFAULT.clone()
5514 }
5515}
5516impl MessageData for ATTITUDE_TARGET_DATA {
5517 type Message = MavMessage;
5518 const ID: u32 = 83u32;
5519 const NAME: &'static str = "ATTITUDE_TARGET";
5520 const EXTRA_CRC: u8 = 22u8;
5521 const ENCODED_LEN: usize = 37usize;
5522 fn deser(
5523 _version: MavlinkVersion,
5524 __input: &[u8],
5525 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5526 let avail_len = __input.len();
5527 let mut payload_buf = [0; Self::ENCODED_LEN];
5528 let mut buf = if avail_len < Self::ENCODED_LEN {
5529 payload_buf[0..avail_len].copy_from_slice(__input);
5530 Bytes::new(&payload_buf)
5531 } else {
5532 Bytes::new(__input)
5533 };
5534 let mut __struct = Self::default();
5535 __struct.time_boot_ms = buf.get_u32_le();
5536 for v in &mut __struct.q {
5537 let val = buf.get_f32_le();
5538 *v = val;
5539 }
5540 __struct.body_roll_rate = buf.get_f32_le();
5541 __struct.body_pitch_rate = buf.get_f32_le();
5542 __struct.body_yaw_rate = buf.get_f32_le();
5543 __struct.thrust = buf.get_f32_le();
5544 let tmp = buf.get_u8();
5545 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5546 tmp & AttitudeTargetTypemask::all().bits(),
5547 )
5548 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5549 flag_type: "AttitudeTargetTypemask",
5550 value: tmp as u32,
5551 })?;
5552 Ok(__struct)
5553 }
5554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5555 let mut __tmp = BytesMut::new(bytes);
5556 #[allow(clippy::absurd_extreme_comparisons)]
5557 #[allow(unused_comparisons)]
5558 if __tmp.remaining() < Self::ENCODED_LEN {
5559 panic!(
5560 "buffer is too small (need {} bytes, but got {})",
5561 Self::ENCODED_LEN,
5562 __tmp.remaining(),
5563 )
5564 }
5565 __tmp.put_u32_le(self.time_boot_ms);
5566 for val in &self.q {
5567 __tmp.put_f32_le(*val);
5568 }
5569 __tmp.put_f32_le(self.body_roll_rate);
5570 __tmp.put_f32_le(self.body_pitch_rate);
5571 __tmp.put_f32_le(self.body_yaw_rate);
5572 __tmp.put_f32_le(self.thrust);
5573 __tmp.put_u8(self.type_mask.bits());
5574 if matches!(version, MavlinkVersion::V2) {
5575 let len = __tmp.len();
5576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5577 } else {
5578 __tmp.len()
5579 }
5580 }
5581}
5582#[doc = "id: 138"]
5583#[doc = "Motion capture attitude and position."]
5584#[derive(Debug, Clone, PartialEq)]
5585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5587pub struct ATT_POS_MOCAP_DATA {
5588 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5589 pub time_usec: u64,
5590 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5591 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5592 pub q: [f32; 4],
5593 #[doc = "X position (NED)"]
5594 pub x: f32,
5595 #[doc = "Y position (NED)"]
5596 pub y: f32,
5597 #[doc = "Z position (NED)"]
5598 pub z: f32,
5599 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5600 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5602 pub covariance: [f32; 21],
5603}
5604impl ATT_POS_MOCAP_DATA {
5605 pub const ENCODED_LEN: usize = 120usize;
5606 pub const DEFAULT: Self = Self {
5607 time_usec: 0_u64,
5608 q: [0.0_f32; 4usize],
5609 x: 0.0_f32,
5610 y: 0.0_f32,
5611 z: 0.0_f32,
5612 covariance: [0.0_f32; 21usize],
5613 };
5614 #[cfg(feature = "arbitrary")]
5615 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5616 use arbitrary::{Arbitrary, Unstructured};
5617 let mut buf = [0u8; 1024];
5618 rng.fill_bytes(&mut buf);
5619 let mut unstructured = Unstructured::new(&buf);
5620 Self::arbitrary(&mut unstructured).unwrap_or_default()
5621 }
5622}
5623impl Default for ATT_POS_MOCAP_DATA {
5624 fn default() -> Self {
5625 Self::DEFAULT.clone()
5626 }
5627}
5628impl MessageData for ATT_POS_MOCAP_DATA {
5629 type Message = MavMessage;
5630 const ID: u32 = 138u32;
5631 const NAME: &'static str = "ATT_POS_MOCAP";
5632 const EXTRA_CRC: u8 = 109u8;
5633 const ENCODED_LEN: usize = 120usize;
5634 fn deser(
5635 _version: MavlinkVersion,
5636 __input: &[u8],
5637 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5638 let avail_len = __input.len();
5639 let mut payload_buf = [0; Self::ENCODED_LEN];
5640 let mut buf = if avail_len < Self::ENCODED_LEN {
5641 payload_buf[0..avail_len].copy_from_slice(__input);
5642 Bytes::new(&payload_buf)
5643 } else {
5644 Bytes::new(__input)
5645 };
5646 let mut __struct = Self::default();
5647 __struct.time_usec = buf.get_u64_le();
5648 for v in &mut __struct.q {
5649 let val = buf.get_f32_le();
5650 *v = val;
5651 }
5652 __struct.x = buf.get_f32_le();
5653 __struct.y = buf.get_f32_le();
5654 __struct.z = buf.get_f32_le();
5655 for v in &mut __struct.covariance {
5656 let val = buf.get_f32_le();
5657 *v = val;
5658 }
5659 Ok(__struct)
5660 }
5661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5662 let mut __tmp = BytesMut::new(bytes);
5663 #[allow(clippy::absurd_extreme_comparisons)]
5664 #[allow(unused_comparisons)]
5665 if __tmp.remaining() < Self::ENCODED_LEN {
5666 panic!(
5667 "buffer is too small (need {} bytes, but got {})",
5668 Self::ENCODED_LEN,
5669 __tmp.remaining(),
5670 )
5671 }
5672 __tmp.put_u64_le(self.time_usec);
5673 for val in &self.q {
5674 __tmp.put_f32_le(*val);
5675 }
5676 __tmp.put_f32_le(self.x);
5677 __tmp.put_f32_le(self.y);
5678 __tmp.put_f32_le(self.z);
5679 for val in &self.covariance {
5680 __tmp.put_f32_le(*val);
5681 }
5682 if matches!(version, MavlinkVersion::V2) {
5683 let len = __tmp.len();
5684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5685 } else {
5686 __tmp.len()
5687 }
5688 }
5689}
5690#[doc = "id: 7"]
5691#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5692#[derive(Debug, Clone, PartialEq)]
5693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5695pub struct AUTH_KEY_DATA {
5696 #[doc = "key"]
5697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5698 pub key: [u8; 32],
5699}
5700impl AUTH_KEY_DATA {
5701 pub const ENCODED_LEN: usize = 32usize;
5702 pub const DEFAULT: Self = Self {
5703 key: [0_u8; 32usize],
5704 };
5705 #[cfg(feature = "arbitrary")]
5706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5707 use arbitrary::{Arbitrary, Unstructured};
5708 let mut buf = [0u8; 1024];
5709 rng.fill_bytes(&mut buf);
5710 let mut unstructured = Unstructured::new(&buf);
5711 Self::arbitrary(&mut unstructured).unwrap_or_default()
5712 }
5713}
5714impl Default for AUTH_KEY_DATA {
5715 fn default() -> Self {
5716 Self::DEFAULT.clone()
5717 }
5718}
5719impl MessageData for AUTH_KEY_DATA {
5720 type Message = MavMessage;
5721 const ID: u32 = 7u32;
5722 const NAME: &'static str = "AUTH_KEY";
5723 const EXTRA_CRC: u8 = 119u8;
5724 const ENCODED_LEN: usize = 32usize;
5725 fn deser(
5726 _version: MavlinkVersion,
5727 __input: &[u8],
5728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5729 let avail_len = __input.len();
5730 let mut payload_buf = [0; Self::ENCODED_LEN];
5731 let mut buf = if avail_len < Self::ENCODED_LEN {
5732 payload_buf[0..avail_len].copy_from_slice(__input);
5733 Bytes::new(&payload_buf)
5734 } else {
5735 Bytes::new(__input)
5736 };
5737 let mut __struct = Self::default();
5738 for v in &mut __struct.key {
5739 let val = buf.get_u8();
5740 *v = val;
5741 }
5742 Ok(__struct)
5743 }
5744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5745 let mut __tmp = BytesMut::new(bytes);
5746 #[allow(clippy::absurd_extreme_comparisons)]
5747 #[allow(unused_comparisons)]
5748 if __tmp.remaining() < Self::ENCODED_LEN {
5749 panic!(
5750 "buffer is too small (need {} bytes, but got {})",
5751 Self::ENCODED_LEN,
5752 __tmp.remaining(),
5753 )
5754 }
5755 for val in &self.key {
5756 __tmp.put_u8(*val);
5757 }
5758 if matches!(version, MavlinkVersion::V2) {
5759 let len = __tmp.len();
5760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5761 } else {
5762 __tmp.len()
5763 }
5764 }
5765}
5766#[doc = "id: 286"]
5767#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5768#[derive(Debug, Clone, PartialEq)]
5769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5771pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5772 #[doc = "Timestamp (time since system boot)."]
5773 pub time_boot_us: u64,
5774 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5776 pub q: [f32; 4],
5777 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5778 pub q_estimated_delay_us: u32,
5779 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5780 pub vx: f32,
5781 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5782 pub vy: f32,
5783 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5784 pub vz: f32,
5785 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5786 pub v_estimated_delay_us: u32,
5787 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5788 pub feed_forward_angular_velocity_z: f32,
5789 #[doc = "Bitmap indicating which estimator outputs are valid."]
5790 pub estimator_status: EstimatorStatusFlags,
5791 #[doc = "System ID"]
5792 pub target_system: u8,
5793 #[doc = "Component ID"]
5794 pub target_component: u8,
5795 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5796 pub landed_state: MavLandedState,
5797 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5798 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5799 pub angular_velocity_z: f32,
5800}
5801impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5802 pub const ENCODED_LEN: usize = 57usize;
5803 pub const DEFAULT: Self = Self {
5804 time_boot_us: 0_u64,
5805 q: [0.0_f32; 4usize],
5806 q_estimated_delay_us: 0_u32,
5807 vx: 0.0_f32,
5808 vy: 0.0_f32,
5809 vz: 0.0_f32,
5810 v_estimated_delay_us: 0_u32,
5811 feed_forward_angular_velocity_z: 0.0_f32,
5812 estimator_status: EstimatorStatusFlags::DEFAULT,
5813 target_system: 0_u8,
5814 target_component: 0_u8,
5815 landed_state: MavLandedState::DEFAULT,
5816 angular_velocity_z: 0.0_f32,
5817 };
5818 #[cfg(feature = "arbitrary")]
5819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5820 use arbitrary::{Arbitrary, Unstructured};
5821 let mut buf = [0u8; 1024];
5822 rng.fill_bytes(&mut buf);
5823 let mut unstructured = Unstructured::new(&buf);
5824 Self::arbitrary(&mut unstructured).unwrap_or_default()
5825 }
5826}
5827impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5828 fn default() -> Self {
5829 Self::DEFAULT.clone()
5830 }
5831}
5832impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5833 type Message = MavMessage;
5834 const ID: u32 = 286u32;
5835 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5836 const EXTRA_CRC: u8 = 210u8;
5837 const ENCODED_LEN: usize = 57usize;
5838 fn deser(
5839 _version: MavlinkVersion,
5840 __input: &[u8],
5841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5842 let avail_len = __input.len();
5843 let mut payload_buf = [0; Self::ENCODED_LEN];
5844 let mut buf = if avail_len < Self::ENCODED_LEN {
5845 payload_buf[0..avail_len].copy_from_slice(__input);
5846 Bytes::new(&payload_buf)
5847 } else {
5848 Bytes::new(__input)
5849 };
5850 let mut __struct = Self::default();
5851 __struct.time_boot_us = buf.get_u64_le();
5852 for v in &mut __struct.q {
5853 let val = buf.get_f32_le();
5854 *v = val;
5855 }
5856 __struct.q_estimated_delay_us = buf.get_u32_le();
5857 __struct.vx = buf.get_f32_le();
5858 __struct.vy = buf.get_f32_le();
5859 __struct.vz = buf.get_f32_le();
5860 __struct.v_estimated_delay_us = buf.get_u32_le();
5861 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5862 let tmp = buf.get_u16_le();
5863 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5864 tmp & EstimatorStatusFlags::all().bits(),
5865 )
5866 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5867 flag_type: "EstimatorStatusFlags",
5868 value: tmp as u32,
5869 })?;
5870 __struct.target_system = buf.get_u8();
5871 __struct.target_component = buf.get_u8();
5872 let tmp = buf.get_u8();
5873 __struct.landed_state =
5874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5875 enum_type: "MavLandedState",
5876 value: tmp as u32,
5877 })?;
5878 __struct.angular_velocity_z = buf.get_f32_le();
5879 Ok(__struct)
5880 }
5881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5882 let mut __tmp = BytesMut::new(bytes);
5883 #[allow(clippy::absurd_extreme_comparisons)]
5884 #[allow(unused_comparisons)]
5885 if __tmp.remaining() < Self::ENCODED_LEN {
5886 panic!(
5887 "buffer is too small (need {} bytes, but got {})",
5888 Self::ENCODED_LEN,
5889 __tmp.remaining(),
5890 )
5891 }
5892 __tmp.put_u64_le(self.time_boot_us);
5893 for val in &self.q {
5894 __tmp.put_f32_le(*val);
5895 }
5896 __tmp.put_u32_le(self.q_estimated_delay_us);
5897 __tmp.put_f32_le(self.vx);
5898 __tmp.put_f32_le(self.vy);
5899 __tmp.put_f32_le(self.vz);
5900 __tmp.put_u32_le(self.v_estimated_delay_us);
5901 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5902 __tmp.put_u16_le(self.estimator_status.bits());
5903 __tmp.put_u8(self.target_system);
5904 __tmp.put_u8(self.target_component);
5905 __tmp.put_u8(self.landed_state as u8);
5906 __tmp.put_f32_le(self.angular_velocity_z);
5907 if matches!(version, MavlinkVersion::V2) {
5908 let len = __tmp.len();
5909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5910 } else {
5911 __tmp.len()
5912 }
5913 }
5914}
5915#[doc = "id: 148"]
5916#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5917#[derive(Debug, Clone, PartialEq)]
5918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5920pub struct AUTOPILOT_VERSION_DATA {
5921 #[doc = "Bitmap of capabilities"]
5922 pub capabilities: MavProtocolCapability,
5923 #[doc = "UID if provided by hardware (see uid2)"]
5924 pub uid: u64,
5925 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5926 pub flight_sw_version: u32,
5927 #[doc = "Middleware version number"]
5928 pub middleware_sw_version: u32,
5929 #[doc = "Operating system version number"]
5930 pub os_sw_version: u32,
5931 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5932 pub board_version: u32,
5933 #[doc = "ID of the board vendor"]
5934 pub vendor_id: u16,
5935 #[doc = "ID of the product"]
5936 pub product_id: u16,
5937 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5939 pub flight_custom_version: [u8; 8],
5940 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5942 pub middleware_custom_version: [u8; 8],
5943 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5944 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5945 pub os_custom_version: [u8; 8],
5946 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5947 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5948 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5949 pub uid2: [u8; 18],
5950}
5951impl AUTOPILOT_VERSION_DATA {
5952 pub const ENCODED_LEN: usize = 78usize;
5953 pub const DEFAULT: Self = Self {
5954 capabilities: MavProtocolCapability::DEFAULT,
5955 uid: 0_u64,
5956 flight_sw_version: 0_u32,
5957 middleware_sw_version: 0_u32,
5958 os_sw_version: 0_u32,
5959 board_version: 0_u32,
5960 vendor_id: 0_u16,
5961 product_id: 0_u16,
5962 flight_custom_version: [0_u8; 8usize],
5963 middleware_custom_version: [0_u8; 8usize],
5964 os_custom_version: [0_u8; 8usize],
5965 uid2: [0_u8; 18usize],
5966 };
5967 #[cfg(feature = "arbitrary")]
5968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5969 use arbitrary::{Arbitrary, Unstructured};
5970 let mut buf = [0u8; 1024];
5971 rng.fill_bytes(&mut buf);
5972 let mut unstructured = Unstructured::new(&buf);
5973 Self::arbitrary(&mut unstructured).unwrap_or_default()
5974 }
5975}
5976impl Default for AUTOPILOT_VERSION_DATA {
5977 fn default() -> Self {
5978 Self::DEFAULT.clone()
5979 }
5980}
5981impl MessageData for AUTOPILOT_VERSION_DATA {
5982 type Message = MavMessage;
5983 const ID: u32 = 148u32;
5984 const NAME: &'static str = "AUTOPILOT_VERSION";
5985 const EXTRA_CRC: u8 = 178u8;
5986 const ENCODED_LEN: usize = 78usize;
5987 fn deser(
5988 _version: MavlinkVersion,
5989 __input: &[u8],
5990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5991 let avail_len = __input.len();
5992 let mut payload_buf = [0; Self::ENCODED_LEN];
5993 let mut buf = if avail_len < Self::ENCODED_LEN {
5994 payload_buf[0..avail_len].copy_from_slice(__input);
5995 Bytes::new(&payload_buf)
5996 } else {
5997 Bytes::new(__input)
5998 };
5999 let mut __struct = Self::default();
6000 let tmp = buf.get_u64_le();
6001 __struct.capabilities = MavProtocolCapability::from_bits(
6002 tmp & MavProtocolCapability::all().bits(),
6003 )
6004 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6005 flag_type: "MavProtocolCapability",
6006 value: tmp as u32,
6007 })?;
6008 __struct.uid = buf.get_u64_le();
6009 __struct.flight_sw_version = buf.get_u32_le();
6010 __struct.middleware_sw_version = buf.get_u32_le();
6011 __struct.os_sw_version = buf.get_u32_le();
6012 __struct.board_version = buf.get_u32_le();
6013 __struct.vendor_id = buf.get_u16_le();
6014 __struct.product_id = buf.get_u16_le();
6015 for v in &mut __struct.flight_custom_version {
6016 let val = buf.get_u8();
6017 *v = val;
6018 }
6019 for v in &mut __struct.middleware_custom_version {
6020 let val = buf.get_u8();
6021 *v = val;
6022 }
6023 for v in &mut __struct.os_custom_version {
6024 let val = buf.get_u8();
6025 *v = val;
6026 }
6027 for v in &mut __struct.uid2 {
6028 let val = buf.get_u8();
6029 *v = val;
6030 }
6031 Ok(__struct)
6032 }
6033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6034 let mut __tmp = BytesMut::new(bytes);
6035 #[allow(clippy::absurd_extreme_comparisons)]
6036 #[allow(unused_comparisons)]
6037 if __tmp.remaining() < Self::ENCODED_LEN {
6038 panic!(
6039 "buffer is too small (need {} bytes, but got {})",
6040 Self::ENCODED_LEN,
6041 __tmp.remaining(),
6042 )
6043 }
6044 __tmp.put_u64_le(self.capabilities.bits());
6045 __tmp.put_u64_le(self.uid);
6046 __tmp.put_u32_le(self.flight_sw_version);
6047 __tmp.put_u32_le(self.middleware_sw_version);
6048 __tmp.put_u32_le(self.os_sw_version);
6049 __tmp.put_u32_le(self.board_version);
6050 __tmp.put_u16_le(self.vendor_id);
6051 __tmp.put_u16_le(self.product_id);
6052 for val in &self.flight_custom_version {
6053 __tmp.put_u8(*val);
6054 }
6055 for val in &self.middleware_custom_version {
6056 __tmp.put_u8(*val);
6057 }
6058 for val in &self.os_custom_version {
6059 __tmp.put_u8(*val);
6060 }
6061 for val in &self.uid2 {
6062 __tmp.put_u8(*val);
6063 }
6064 if matches!(version, MavlinkVersion::V2) {
6065 let len = __tmp.len();
6066 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6067 } else {
6068 __tmp.len()
6069 }
6070 }
6071}
6072#[doc = "id: 435"]
6073#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6074#[derive(Debug, Clone, PartialEq)]
6075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6077pub struct AVAILABLE_MODES_DATA {
6078 #[doc = "A bitfield for use for autopilot-specific flags"]
6079 pub custom_mode: u32,
6080 #[doc = "Mode properties."]
6081 pub properties: MavModeProperty,
6082 #[doc = "The total number of available modes for the current vehicle type."]
6083 pub number_modes: u8,
6084 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6085 pub mode_index: u8,
6086 #[doc = "Standard mode."]
6087 pub standard_mode: MavStandardMode,
6088 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6090 pub mode_name: [u8; 35],
6091}
6092impl AVAILABLE_MODES_DATA {
6093 pub const ENCODED_LEN: usize = 46usize;
6094 pub const DEFAULT: Self = Self {
6095 custom_mode: 0_u32,
6096 properties: MavModeProperty::DEFAULT,
6097 number_modes: 0_u8,
6098 mode_index: 0_u8,
6099 standard_mode: MavStandardMode::DEFAULT,
6100 mode_name: [0_u8; 35usize],
6101 };
6102 #[cfg(feature = "arbitrary")]
6103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6104 use arbitrary::{Arbitrary, Unstructured};
6105 let mut buf = [0u8; 1024];
6106 rng.fill_bytes(&mut buf);
6107 let mut unstructured = Unstructured::new(&buf);
6108 Self::arbitrary(&mut unstructured).unwrap_or_default()
6109 }
6110}
6111impl Default for AVAILABLE_MODES_DATA {
6112 fn default() -> Self {
6113 Self::DEFAULT.clone()
6114 }
6115}
6116impl MessageData for AVAILABLE_MODES_DATA {
6117 type Message = MavMessage;
6118 const ID: u32 = 435u32;
6119 const NAME: &'static str = "AVAILABLE_MODES";
6120 const EXTRA_CRC: u8 = 134u8;
6121 const ENCODED_LEN: usize = 46usize;
6122 fn deser(
6123 _version: MavlinkVersion,
6124 __input: &[u8],
6125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6126 let avail_len = __input.len();
6127 let mut payload_buf = [0; Self::ENCODED_LEN];
6128 let mut buf = if avail_len < Self::ENCODED_LEN {
6129 payload_buf[0..avail_len].copy_from_slice(__input);
6130 Bytes::new(&payload_buf)
6131 } else {
6132 Bytes::new(__input)
6133 };
6134 let mut __struct = Self::default();
6135 __struct.custom_mode = buf.get_u32_le();
6136 let tmp = buf.get_u32_le();
6137 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6138 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6139 flag_type: "MavModeProperty",
6140 value: tmp as u32,
6141 })?;
6142 __struct.number_modes = buf.get_u8();
6143 __struct.mode_index = buf.get_u8();
6144 let tmp = buf.get_u8();
6145 __struct.standard_mode =
6146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6147 enum_type: "MavStandardMode",
6148 value: tmp as u32,
6149 })?;
6150 for v in &mut __struct.mode_name {
6151 let val = buf.get_u8();
6152 *v = val;
6153 }
6154 Ok(__struct)
6155 }
6156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6157 let mut __tmp = BytesMut::new(bytes);
6158 #[allow(clippy::absurd_extreme_comparisons)]
6159 #[allow(unused_comparisons)]
6160 if __tmp.remaining() < Self::ENCODED_LEN {
6161 panic!(
6162 "buffer is too small (need {} bytes, but got {})",
6163 Self::ENCODED_LEN,
6164 __tmp.remaining(),
6165 )
6166 }
6167 __tmp.put_u32_le(self.custom_mode);
6168 __tmp.put_u32_le(self.properties.bits());
6169 __tmp.put_u8(self.number_modes);
6170 __tmp.put_u8(self.mode_index);
6171 __tmp.put_u8(self.standard_mode as u8);
6172 for val in &self.mode_name {
6173 __tmp.put_u8(*val);
6174 }
6175 if matches!(version, MavlinkVersion::V2) {
6176 let len = __tmp.len();
6177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6178 } else {
6179 __tmp.len()
6180 }
6181 }
6182}
6183#[doc = "id: 437"]
6184#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6185#[derive(Debug, Clone, PartialEq)]
6186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6188pub struct AVAILABLE_MODES_MONITOR_DATA {
6189 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6190 pub seq: u8,
6191}
6192impl AVAILABLE_MODES_MONITOR_DATA {
6193 pub const ENCODED_LEN: usize = 1usize;
6194 pub const DEFAULT: Self = Self { seq: 0_u8 };
6195 #[cfg(feature = "arbitrary")]
6196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6197 use arbitrary::{Arbitrary, Unstructured};
6198 let mut buf = [0u8; 1024];
6199 rng.fill_bytes(&mut buf);
6200 let mut unstructured = Unstructured::new(&buf);
6201 Self::arbitrary(&mut unstructured).unwrap_or_default()
6202 }
6203}
6204impl Default for AVAILABLE_MODES_MONITOR_DATA {
6205 fn default() -> Self {
6206 Self::DEFAULT.clone()
6207 }
6208}
6209impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6210 type Message = MavMessage;
6211 const ID: u32 = 437u32;
6212 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6213 const EXTRA_CRC: u8 = 30u8;
6214 const ENCODED_LEN: usize = 1usize;
6215 fn deser(
6216 _version: MavlinkVersion,
6217 __input: &[u8],
6218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6219 let avail_len = __input.len();
6220 let mut payload_buf = [0; Self::ENCODED_LEN];
6221 let mut buf = if avail_len < Self::ENCODED_LEN {
6222 payload_buf[0..avail_len].copy_from_slice(__input);
6223 Bytes::new(&payload_buf)
6224 } else {
6225 Bytes::new(__input)
6226 };
6227 let mut __struct = Self::default();
6228 __struct.seq = buf.get_u8();
6229 Ok(__struct)
6230 }
6231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6232 let mut __tmp = BytesMut::new(bytes);
6233 #[allow(clippy::absurd_extreme_comparisons)]
6234 #[allow(unused_comparisons)]
6235 if __tmp.remaining() < Self::ENCODED_LEN {
6236 panic!(
6237 "buffer is too small (need {} bytes, but got {})",
6238 Self::ENCODED_LEN,
6239 __tmp.remaining(),
6240 )
6241 }
6242 __tmp.put_u8(self.seq);
6243 if matches!(version, MavlinkVersion::V2) {
6244 let len = __tmp.len();
6245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6246 } else {
6247 __tmp.len()
6248 }
6249 }
6250}
6251#[doc = "id: 60052"]
6252#[doc = "Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6253#[derive(Debug, Clone, PartialEq)]
6254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6256pub struct AVSS_DRONE_IMU_DATA {
6257 #[doc = "Timestamp (time since FC boot)."]
6258 pub time_boot_ms: u32,
6259 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
6260 pub q1: f32,
6261 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
6262 pub q2: f32,
6263 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
6264 pub q3: f32,
6265 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
6266 pub q4: f32,
6267 #[doc = "X acceleration"]
6268 pub xacc: f32,
6269 #[doc = "Y acceleration"]
6270 pub yacc: f32,
6271 #[doc = "Z acceleration"]
6272 pub zacc: f32,
6273 #[doc = "Angular speed around X axis"]
6274 pub xgyro: f32,
6275 #[doc = "Angular speed around Y axis"]
6276 pub ygyro: f32,
6277 #[doc = "Angular speed around Z axis"]
6278 pub zgyro: f32,
6279}
6280impl AVSS_DRONE_IMU_DATA {
6281 pub const ENCODED_LEN: usize = 44usize;
6282 pub const DEFAULT: Self = Self {
6283 time_boot_ms: 0_u32,
6284 q1: 0.0_f32,
6285 q2: 0.0_f32,
6286 q3: 0.0_f32,
6287 q4: 0.0_f32,
6288 xacc: 0.0_f32,
6289 yacc: 0.0_f32,
6290 zacc: 0.0_f32,
6291 xgyro: 0.0_f32,
6292 ygyro: 0.0_f32,
6293 zgyro: 0.0_f32,
6294 };
6295 #[cfg(feature = "arbitrary")]
6296 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6297 use arbitrary::{Arbitrary, Unstructured};
6298 let mut buf = [0u8; 1024];
6299 rng.fill_bytes(&mut buf);
6300 let mut unstructured = Unstructured::new(&buf);
6301 Self::arbitrary(&mut unstructured).unwrap_or_default()
6302 }
6303}
6304impl Default for AVSS_DRONE_IMU_DATA {
6305 fn default() -> Self {
6306 Self::DEFAULT.clone()
6307 }
6308}
6309impl MessageData for AVSS_DRONE_IMU_DATA {
6310 type Message = MavMessage;
6311 const ID: u32 = 60052u32;
6312 const NAME: &'static str = "AVSS_DRONE_IMU";
6313 const EXTRA_CRC: u8 = 101u8;
6314 const ENCODED_LEN: usize = 44usize;
6315 fn deser(
6316 _version: MavlinkVersion,
6317 __input: &[u8],
6318 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6319 let avail_len = __input.len();
6320 let mut payload_buf = [0; Self::ENCODED_LEN];
6321 let mut buf = if avail_len < Self::ENCODED_LEN {
6322 payload_buf[0..avail_len].copy_from_slice(__input);
6323 Bytes::new(&payload_buf)
6324 } else {
6325 Bytes::new(__input)
6326 };
6327 let mut __struct = Self::default();
6328 __struct.time_boot_ms = buf.get_u32_le();
6329 __struct.q1 = buf.get_f32_le();
6330 __struct.q2 = buf.get_f32_le();
6331 __struct.q3 = buf.get_f32_le();
6332 __struct.q4 = buf.get_f32_le();
6333 __struct.xacc = buf.get_f32_le();
6334 __struct.yacc = buf.get_f32_le();
6335 __struct.zacc = buf.get_f32_le();
6336 __struct.xgyro = buf.get_f32_le();
6337 __struct.ygyro = buf.get_f32_le();
6338 __struct.zgyro = buf.get_f32_le();
6339 Ok(__struct)
6340 }
6341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6342 let mut __tmp = BytesMut::new(bytes);
6343 #[allow(clippy::absurd_extreme_comparisons)]
6344 #[allow(unused_comparisons)]
6345 if __tmp.remaining() < Self::ENCODED_LEN {
6346 panic!(
6347 "buffer is too small (need {} bytes, but got {})",
6348 Self::ENCODED_LEN,
6349 __tmp.remaining(),
6350 )
6351 }
6352 __tmp.put_u32_le(self.time_boot_ms);
6353 __tmp.put_f32_le(self.q1);
6354 __tmp.put_f32_le(self.q2);
6355 __tmp.put_f32_le(self.q3);
6356 __tmp.put_f32_le(self.q4);
6357 __tmp.put_f32_le(self.xacc);
6358 __tmp.put_f32_le(self.yacc);
6359 __tmp.put_f32_le(self.zacc);
6360 __tmp.put_f32_le(self.xgyro);
6361 __tmp.put_f32_le(self.ygyro);
6362 __tmp.put_f32_le(self.zgyro);
6363 if matches!(version, MavlinkVersion::V2) {
6364 let len = __tmp.len();
6365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6366 } else {
6367 __tmp.len()
6368 }
6369 }
6370}
6371#[doc = "id: 60053"]
6372#[doc = "Drone operation mode."]
6373#[derive(Debug, Clone, PartialEq)]
6374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6376pub struct AVSS_DRONE_OPERATION_MODE_DATA {
6377 #[doc = "Timestamp (time since FC boot)."]
6378 pub time_boot_ms: u32,
6379 #[doc = "DJI M300 operation mode"]
6380 pub M300_operation_mode: u8,
6381 #[doc = "horsefly operation mode"]
6382 pub horsefly_operation_mode: u8,
6383}
6384impl AVSS_DRONE_OPERATION_MODE_DATA {
6385 pub const ENCODED_LEN: usize = 6usize;
6386 pub const DEFAULT: Self = Self {
6387 time_boot_ms: 0_u32,
6388 M300_operation_mode: 0_u8,
6389 horsefly_operation_mode: 0_u8,
6390 };
6391 #[cfg(feature = "arbitrary")]
6392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6393 use arbitrary::{Arbitrary, Unstructured};
6394 let mut buf = [0u8; 1024];
6395 rng.fill_bytes(&mut buf);
6396 let mut unstructured = Unstructured::new(&buf);
6397 Self::arbitrary(&mut unstructured).unwrap_or_default()
6398 }
6399}
6400impl Default for AVSS_DRONE_OPERATION_MODE_DATA {
6401 fn default() -> Self {
6402 Self::DEFAULT.clone()
6403 }
6404}
6405impl MessageData for AVSS_DRONE_OPERATION_MODE_DATA {
6406 type Message = MavMessage;
6407 const ID: u32 = 60053u32;
6408 const NAME: &'static str = "AVSS_DRONE_OPERATION_MODE";
6409 const EXTRA_CRC: u8 = 45u8;
6410 const ENCODED_LEN: usize = 6usize;
6411 fn deser(
6412 _version: MavlinkVersion,
6413 __input: &[u8],
6414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6415 let avail_len = __input.len();
6416 let mut payload_buf = [0; Self::ENCODED_LEN];
6417 let mut buf = if avail_len < Self::ENCODED_LEN {
6418 payload_buf[0..avail_len].copy_from_slice(__input);
6419 Bytes::new(&payload_buf)
6420 } else {
6421 Bytes::new(__input)
6422 };
6423 let mut __struct = Self::default();
6424 __struct.time_boot_ms = buf.get_u32_le();
6425 __struct.M300_operation_mode = buf.get_u8();
6426 __struct.horsefly_operation_mode = buf.get_u8();
6427 Ok(__struct)
6428 }
6429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6430 let mut __tmp = BytesMut::new(bytes);
6431 #[allow(clippy::absurd_extreme_comparisons)]
6432 #[allow(unused_comparisons)]
6433 if __tmp.remaining() < Self::ENCODED_LEN {
6434 panic!(
6435 "buffer is too small (need {} bytes, but got {})",
6436 Self::ENCODED_LEN,
6437 __tmp.remaining(),
6438 )
6439 }
6440 __tmp.put_u32_le(self.time_boot_ms);
6441 __tmp.put_u8(self.M300_operation_mode);
6442 __tmp.put_u8(self.horsefly_operation_mode);
6443 if matches!(version, MavlinkVersion::V2) {
6444 let len = __tmp.len();
6445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6446 } else {
6447 __tmp.len()
6448 }
6449 }
6450}
6451#[doc = "id: 60051"]
6452#[doc = "Drone position."]
6453#[derive(Debug, Clone, PartialEq)]
6454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6456pub struct AVSS_DRONE_POSITION_DATA {
6457 #[doc = "Timestamp (time since FC boot)."]
6458 pub time_boot_ms: u32,
6459 #[doc = "Latitude, expressed"]
6460 pub lat: i32,
6461 #[doc = "Longitude, expressed"]
6462 pub lon: i32,
6463 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
6464 pub alt: i32,
6465 #[doc = "Altitude above ground, This altitude is measured by a ultrasound, Laser rangefinder or millimeter-wave radar"]
6466 pub ground_alt: f32,
6467 #[doc = "This altitude is measured by a barometer"]
6468 pub barometer_alt: f32,
6469}
6470impl AVSS_DRONE_POSITION_DATA {
6471 pub const ENCODED_LEN: usize = 24usize;
6472 pub const DEFAULT: Self = Self {
6473 time_boot_ms: 0_u32,
6474 lat: 0_i32,
6475 lon: 0_i32,
6476 alt: 0_i32,
6477 ground_alt: 0.0_f32,
6478 barometer_alt: 0.0_f32,
6479 };
6480 #[cfg(feature = "arbitrary")]
6481 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6482 use arbitrary::{Arbitrary, Unstructured};
6483 let mut buf = [0u8; 1024];
6484 rng.fill_bytes(&mut buf);
6485 let mut unstructured = Unstructured::new(&buf);
6486 Self::arbitrary(&mut unstructured).unwrap_or_default()
6487 }
6488}
6489impl Default for AVSS_DRONE_POSITION_DATA {
6490 fn default() -> Self {
6491 Self::DEFAULT.clone()
6492 }
6493}
6494impl MessageData for AVSS_DRONE_POSITION_DATA {
6495 type Message = MavMessage;
6496 const ID: u32 = 60051u32;
6497 const NAME: &'static str = "AVSS_DRONE_POSITION";
6498 const EXTRA_CRC: u8 = 245u8;
6499 const ENCODED_LEN: usize = 24usize;
6500 fn deser(
6501 _version: MavlinkVersion,
6502 __input: &[u8],
6503 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6504 let avail_len = __input.len();
6505 let mut payload_buf = [0; Self::ENCODED_LEN];
6506 let mut buf = if avail_len < Self::ENCODED_LEN {
6507 payload_buf[0..avail_len].copy_from_slice(__input);
6508 Bytes::new(&payload_buf)
6509 } else {
6510 Bytes::new(__input)
6511 };
6512 let mut __struct = Self::default();
6513 __struct.time_boot_ms = buf.get_u32_le();
6514 __struct.lat = buf.get_i32_le();
6515 __struct.lon = buf.get_i32_le();
6516 __struct.alt = buf.get_i32_le();
6517 __struct.ground_alt = buf.get_f32_le();
6518 __struct.barometer_alt = buf.get_f32_le();
6519 Ok(__struct)
6520 }
6521 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6522 let mut __tmp = BytesMut::new(bytes);
6523 #[allow(clippy::absurd_extreme_comparisons)]
6524 #[allow(unused_comparisons)]
6525 if __tmp.remaining() < Self::ENCODED_LEN {
6526 panic!(
6527 "buffer is too small (need {} bytes, but got {})",
6528 Self::ENCODED_LEN,
6529 __tmp.remaining(),
6530 )
6531 }
6532 __tmp.put_u32_le(self.time_boot_ms);
6533 __tmp.put_i32_le(self.lat);
6534 __tmp.put_i32_le(self.lon);
6535 __tmp.put_i32_le(self.alt);
6536 __tmp.put_f32_le(self.ground_alt);
6537 __tmp.put_f32_le(self.barometer_alt);
6538 if matches!(version, MavlinkVersion::V2) {
6539 let len = __tmp.len();
6540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6541 } else {
6542 __tmp.len()
6543 }
6544 }
6545}
6546#[doc = "id: 60050"]
6547#[doc = "AVSS PRS system status."]
6548#[derive(Debug, Clone, PartialEq)]
6549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6551pub struct AVSS_PRS_SYS_STATUS_DATA {
6552 #[doc = "Timestamp (time since PRS boot)."]
6553 pub time_boot_ms: u32,
6554 #[doc = "PRS error statuses"]
6555 pub error_status: u32,
6556 #[doc = "Estimated battery run-time without a remote connection and PRS battery voltage"]
6557 pub battery_status: u32,
6558 #[doc = "PRS arm statuses"]
6559 pub arm_status: u8,
6560 #[doc = "PRS battery charge statuses"]
6561 pub charge_status: u8,
6562}
6563impl AVSS_PRS_SYS_STATUS_DATA {
6564 pub const ENCODED_LEN: usize = 14usize;
6565 pub const DEFAULT: Self = Self {
6566 time_boot_ms: 0_u32,
6567 error_status: 0_u32,
6568 battery_status: 0_u32,
6569 arm_status: 0_u8,
6570 charge_status: 0_u8,
6571 };
6572 #[cfg(feature = "arbitrary")]
6573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6574 use arbitrary::{Arbitrary, Unstructured};
6575 let mut buf = [0u8; 1024];
6576 rng.fill_bytes(&mut buf);
6577 let mut unstructured = Unstructured::new(&buf);
6578 Self::arbitrary(&mut unstructured).unwrap_or_default()
6579 }
6580}
6581impl Default for AVSS_PRS_SYS_STATUS_DATA {
6582 fn default() -> Self {
6583 Self::DEFAULT.clone()
6584 }
6585}
6586impl MessageData for AVSS_PRS_SYS_STATUS_DATA {
6587 type Message = MavMessage;
6588 const ID: u32 = 60050u32;
6589 const NAME: &'static str = "AVSS_PRS_SYS_STATUS";
6590 const EXTRA_CRC: u8 = 220u8;
6591 const ENCODED_LEN: usize = 14usize;
6592 fn deser(
6593 _version: MavlinkVersion,
6594 __input: &[u8],
6595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6596 let avail_len = __input.len();
6597 let mut payload_buf = [0; Self::ENCODED_LEN];
6598 let mut buf = if avail_len < Self::ENCODED_LEN {
6599 payload_buf[0..avail_len].copy_from_slice(__input);
6600 Bytes::new(&payload_buf)
6601 } else {
6602 Bytes::new(__input)
6603 };
6604 let mut __struct = Self::default();
6605 __struct.time_boot_ms = buf.get_u32_le();
6606 __struct.error_status = buf.get_u32_le();
6607 __struct.battery_status = buf.get_u32_le();
6608 __struct.arm_status = buf.get_u8();
6609 __struct.charge_status = buf.get_u8();
6610 Ok(__struct)
6611 }
6612 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6613 let mut __tmp = BytesMut::new(bytes);
6614 #[allow(clippy::absurd_extreme_comparisons)]
6615 #[allow(unused_comparisons)]
6616 if __tmp.remaining() < Self::ENCODED_LEN {
6617 panic!(
6618 "buffer is too small (need {} bytes, but got {})",
6619 Self::ENCODED_LEN,
6620 __tmp.remaining(),
6621 )
6622 }
6623 __tmp.put_u32_le(self.time_boot_ms);
6624 __tmp.put_u32_le(self.error_status);
6625 __tmp.put_u32_le(self.battery_status);
6626 __tmp.put_u8(self.arm_status);
6627 __tmp.put_u8(self.charge_status);
6628 if matches!(version, MavlinkVersion::V2) {
6629 let len = __tmp.len();
6630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6631 } else {
6632 __tmp.len()
6633 }
6634 }
6635}
6636#[doc = "id: 372"]
6637#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6638#[derive(Debug, Clone, PartialEq)]
6639#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6641pub struct BATTERY_INFO_DATA {
6642 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6643 pub discharge_minimum_voltage: f32,
6644 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6645 pub charging_minimum_voltage: f32,
6646 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6647 pub resting_minimum_voltage: f32,
6648 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6649 pub charging_maximum_voltage: f32,
6650 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6651 pub charging_maximum_current: f32,
6652 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6653 pub nominal_voltage: f32,
6654 #[doc = "Maximum pack discharge current. 0: field not provided."]
6655 pub discharge_maximum_current: f32,
6656 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6657 pub discharge_maximum_burst_current: f32,
6658 #[doc = "Fully charged design capacity. 0: field not provided."]
6659 pub design_capacity: f32,
6660 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6661 pub full_charge_capacity: f32,
6662 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6663 pub cycle_count: u16,
6664 #[doc = "Battery weight. 0: field not provided."]
6665 pub weight: u16,
6666 #[doc = "Battery ID"]
6667 pub id: u8,
6668 #[doc = "Function of the battery."]
6669 pub battery_function: MavBatteryFunction,
6670 #[doc = "Type (chemistry) of the battery."]
6671 pub mavtype: MavBatteryType,
6672 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6673 pub state_of_health: u8,
6674 #[doc = "Number of battery cells in series. 0: field not provided."]
6675 pub cells_in_series: u8,
6676 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6677 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6678 pub manufacture_date: [u8; 9],
6679 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6681 pub serial_number: [u8; 32],
6682 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6683 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6684 pub name: [u8; 50],
6685}
6686impl BATTERY_INFO_DATA {
6687 pub const ENCODED_LEN: usize = 140usize;
6688 pub const DEFAULT: Self = Self {
6689 discharge_minimum_voltage: 0.0_f32,
6690 charging_minimum_voltage: 0.0_f32,
6691 resting_minimum_voltage: 0.0_f32,
6692 charging_maximum_voltage: 0.0_f32,
6693 charging_maximum_current: 0.0_f32,
6694 nominal_voltage: 0.0_f32,
6695 discharge_maximum_current: 0.0_f32,
6696 discharge_maximum_burst_current: 0.0_f32,
6697 design_capacity: 0.0_f32,
6698 full_charge_capacity: 0.0_f32,
6699 cycle_count: 0_u16,
6700 weight: 0_u16,
6701 id: 0_u8,
6702 battery_function: MavBatteryFunction::DEFAULT,
6703 mavtype: MavBatteryType::DEFAULT,
6704 state_of_health: 0_u8,
6705 cells_in_series: 0_u8,
6706 manufacture_date: [0_u8; 9usize],
6707 serial_number: [0_u8; 32usize],
6708 name: [0_u8; 50usize],
6709 };
6710 #[cfg(feature = "arbitrary")]
6711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6712 use arbitrary::{Arbitrary, Unstructured};
6713 let mut buf = [0u8; 1024];
6714 rng.fill_bytes(&mut buf);
6715 let mut unstructured = Unstructured::new(&buf);
6716 Self::arbitrary(&mut unstructured).unwrap_or_default()
6717 }
6718}
6719impl Default for BATTERY_INFO_DATA {
6720 fn default() -> Self {
6721 Self::DEFAULT.clone()
6722 }
6723}
6724impl MessageData for BATTERY_INFO_DATA {
6725 type Message = MavMessage;
6726 const ID: u32 = 372u32;
6727 const NAME: &'static str = "BATTERY_INFO";
6728 const EXTRA_CRC: u8 = 26u8;
6729 const ENCODED_LEN: usize = 140usize;
6730 fn deser(
6731 _version: MavlinkVersion,
6732 __input: &[u8],
6733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6734 let avail_len = __input.len();
6735 let mut payload_buf = [0; Self::ENCODED_LEN];
6736 let mut buf = if avail_len < Self::ENCODED_LEN {
6737 payload_buf[0..avail_len].copy_from_slice(__input);
6738 Bytes::new(&payload_buf)
6739 } else {
6740 Bytes::new(__input)
6741 };
6742 let mut __struct = Self::default();
6743 __struct.discharge_minimum_voltage = buf.get_f32_le();
6744 __struct.charging_minimum_voltage = buf.get_f32_le();
6745 __struct.resting_minimum_voltage = buf.get_f32_le();
6746 __struct.charging_maximum_voltage = buf.get_f32_le();
6747 __struct.charging_maximum_current = buf.get_f32_le();
6748 __struct.nominal_voltage = buf.get_f32_le();
6749 __struct.discharge_maximum_current = buf.get_f32_le();
6750 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6751 __struct.design_capacity = buf.get_f32_le();
6752 __struct.full_charge_capacity = buf.get_f32_le();
6753 __struct.cycle_count = buf.get_u16_le();
6754 __struct.weight = buf.get_u16_le();
6755 __struct.id = buf.get_u8();
6756 let tmp = buf.get_u8();
6757 __struct.battery_function =
6758 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6759 enum_type: "MavBatteryFunction",
6760 value: tmp as u32,
6761 })?;
6762 let tmp = buf.get_u8();
6763 __struct.mavtype =
6764 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6765 enum_type: "MavBatteryType",
6766 value: tmp as u32,
6767 })?;
6768 __struct.state_of_health = buf.get_u8();
6769 __struct.cells_in_series = buf.get_u8();
6770 for v in &mut __struct.manufacture_date {
6771 let val = buf.get_u8();
6772 *v = val;
6773 }
6774 for v in &mut __struct.serial_number {
6775 let val = buf.get_u8();
6776 *v = val;
6777 }
6778 for v in &mut __struct.name {
6779 let val = buf.get_u8();
6780 *v = val;
6781 }
6782 Ok(__struct)
6783 }
6784 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6785 let mut __tmp = BytesMut::new(bytes);
6786 #[allow(clippy::absurd_extreme_comparisons)]
6787 #[allow(unused_comparisons)]
6788 if __tmp.remaining() < Self::ENCODED_LEN {
6789 panic!(
6790 "buffer is too small (need {} bytes, but got {})",
6791 Self::ENCODED_LEN,
6792 __tmp.remaining(),
6793 )
6794 }
6795 __tmp.put_f32_le(self.discharge_minimum_voltage);
6796 __tmp.put_f32_le(self.charging_minimum_voltage);
6797 __tmp.put_f32_le(self.resting_minimum_voltage);
6798 __tmp.put_f32_le(self.charging_maximum_voltage);
6799 __tmp.put_f32_le(self.charging_maximum_current);
6800 __tmp.put_f32_le(self.nominal_voltage);
6801 __tmp.put_f32_le(self.discharge_maximum_current);
6802 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6803 __tmp.put_f32_le(self.design_capacity);
6804 __tmp.put_f32_le(self.full_charge_capacity);
6805 __tmp.put_u16_le(self.cycle_count);
6806 __tmp.put_u16_le(self.weight);
6807 __tmp.put_u8(self.id);
6808 __tmp.put_u8(self.battery_function as u8);
6809 __tmp.put_u8(self.mavtype as u8);
6810 __tmp.put_u8(self.state_of_health);
6811 __tmp.put_u8(self.cells_in_series);
6812 for val in &self.manufacture_date {
6813 __tmp.put_u8(*val);
6814 }
6815 for val in &self.serial_number {
6816 __tmp.put_u8(*val);
6817 }
6818 for val in &self.name {
6819 __tmp.put_u8(*val);
6820 }
6821 if matches!(version, MavlinkVersion::V2) {
6822 let len = __tmp.len();
6823 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6824 } else {
6825 __tmp.len()
6826 }
6827 }
6828}
6829#[doc = "id: 147"]
6830#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6831#[derive(Debug, Clone, PartialEq)]
6832#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6833#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6834pub struct BATTERY_STATUS_DATA {
6835 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6836 pub current_consumed: i32,
6837 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6838 pub energy_consumed: i32,
6839 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6840 pub temperature: i16,
6841 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6843 pub voltages: [u16; 10],
6844 #[doc = "Battery current, -1: autopilot does not measure the current"]
6845 pub current_battery: i16,
6846 #[doc = "Battery ID"]
6847 pub id: u8,
6848 #[doc = "Function of the battery"]
6849 pub battery_function: MavBatteryFunction,
6850 #[doc = "Type (chemistry) of the battery"]
6851 pub mavtype: MavBatteryType,
6852 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6853 pub battery_remaining: i8,
6854 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6855 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6856 pub time_remaining: i32,
6857 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6858 #[cfg_attr(feature = "serde", serde(default))]
6859 pub charge_state: MavBatteryChargeState,
6860 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6861 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6862 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6863 pub voltages_ext: [u16; 4],
6864 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6865 #[cfg_attr(feature = "serde", serde(default))]
6866 pub mode: MavBatteryMode,
6867 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6868 #[cfg_attr(feature = "serde", serde(default))]
6869 pub fault_bitmask: MavBatteryFault,
6870}
6871impl BATTERY_STATUS_DATA {
6872 pub const ENCODED_LEN: usize = 54usize;
6873 pub const DEFAULT: Self = Self {
6874 current_consumed: 0_i32,
6875 energy_consumed: 0_i32,
6876 temperature: 0_i16,
6877 voltages: [0_u16; 10usize],
6878 current_battery: 0_i16,
6879 id: 0_u8,
6880 battery_function: MavBatteryFunction::DEFAULT,
6881 mavtype: MavBatteryType::DEFAULT,
6882 battery_remaining: 0_i8,
6883 time_remaining: 0_i32,
6884 charge_state: MavBatteryChargeState::DEFAULT,
6885 voltages_ext: [0_u16; 4usize],
6886 mode: MavBatteryMode::DEFAULT,
6887 fault_bitmask: MavBatteryFault::DEFAULT,
6888 };
6889 #[cfg(feature = "arbitrary")]
6890 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6891 use arbitrary::{Arbitrary, Unstructured};
6892 let mut buf = [0u8; 1024];
6893 rng.fill_bytes(&mut buf);
6894 let mut unstructured = Unstructured::new(&buf);
6895 Self::arbitrary(&mut unstructured).unwrap_or_default()
6896 }
6897}
6898impl Default for BATTERY_STATUS_DATA {
6899 fn default() -> Self {
6900 Self::DEFAULT.clone()
6901 }
6902}
6903impl MessageData for BATTERY_STATUS_DATA {
6904 type Message = MavMessage;
6905 const ID: u32 = 147u32;
6906 const NAME: &'static str = "BATTERY_STATUS";
6907 const EXTRA_CRC: u8 = 154u8;
6908 const ENCODED_LEN: usize = 54usize;
6909 fn deser(
6910 _version: MavlinkVersion,
6911 __input: &[u8],
6912 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6913 let avail_len = __input.len();
6914 let mut payload_buf = [0; Self::ENCODED_LEN];
6915 let mut buf = if avail_len < Self::ENCODED_LEN {
6916 payload_buf[0..avail_len].copy_from_slice(__input);
6917 Bytes::new(&payload_buf)
6918 } else {
6919 Bytes::new(__input)
6920 };
6921 let mut __struct = Self::default();
6922 __struct.current_consumed = buf.get_i32_le();
6923 __struct.energy_consumed = buf.get_i32_le();
6924 __struct.temperature = buf.get_i16_le();
6925 for v in &mut __struct.voltages {
6926 let val = buf.get_u16_le();
6927 *v = val;
6928 }
6929 __struct.current_battery = buf.get_i16_le();
6930 __struct.id = buf.get_u8();
6931 let tmp = buf.get_u8();
6932 __struct.battery_function =
6933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6934 enum_type: "MavBatteryFunction",
6935 value: tmp as u32,
6936 })?;
6937 let tmp = buf.get_u8();
6938 __struct.mavtype =
6939 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6940 enum_type: "MavBatteryType",
6941 value: tmp as u32,
6942 })?;
6943 __struct.battery_remaining = buf.get_i8();
6944 __struct.time_remaining = buf.get_i32_le();
6945 let tmp = buf.get_u8();
6946 __struct.charge_state =
6947 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6948 enum_type: "MavBatteryChargeState",
6949 value: tmp as u32,
6950 })?;
6951 for v in &mut __struct.voltages_ext {
6952 let val = buf.get_u16_le();
6953 *v = val;
6954 }
6955 let tmp = buf.get_u8();
6956 __struct.mode =
6957 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6958 enum_type: "MavBatteryMode",
6959 value: tmp as u32,
6960 })?;
6961 let tmp = buf.get_u32_le();
6962 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6963 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6964 flag_type: "MavBatteryFault",
6965 value: tmp as u32,
6966 })?;
6967 Ok(__struct)
6968 }
6969 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6970 let mut __tmp = BytesMut::new(bytes);
6971 #[allow(clippy::absurd_extreme_comparisons)]
6972 #[allow(unused_comparisons)]
6973 if __tmp.remaining() < Self::ENCODED_LEN {
6974 panic!(
6975 "buffer is too small (need {} bytes, but got {})",
6976 Self::ENCODED_LEN,
6977 __tmp.remaining(),
6978 )
6979 }
6980 __tmp.put_i32_le(self.current_consumed);
6981 __tmp.put_i32_le(self.energy_consumed);
6982 __tmp.put_i16_le(self.temperature);
6983 for val in &self.voltages {
6984 __tmp.put_u16_le(*val);
6985 }
6986 __tmp.put_i16_le(self.current_battery);
6987 __tmp.put_u8(self.id);
6988 __tmp.put_u8(self.battery_function as u8);
6989 __tmp.put_u8(self.mavtype as u8);
6990 __tmp.put_i8(self.battery_remaining);
6991 __tmp.put_i32_le(self.time_remaining);
6992 __tmp.put_u8(self.charge_state as u8);
6993 for val in &self.voltages_ext {
6994 __tmp.put_u16_le(*val);
6995 }
6996 __tmp.put_u8(self.mode as u8);
6997 __tmp.put_u32_le(self.fault_bitmask.bits());
6998 if matches!(version, MavlinkVersion::V2) {
6999 let len = __tmp.len();
7000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7001 } else {
7002 __tmp.len()
7003 }
7004 }
7005}
7006#[doc = "id: 257"]
7007#[doc = "Report button state change."]
7008#[derive(Debug, Clone, PartialEq)]
7009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7011pub struct BUTTON_CHANGE_DATA {
7012 #[doc = "Timestamp (time since system boot)."]
7013 pub time_boot_ms: u32,
7014 #[doc = "Time of last change of button state."]
7015 pub last_change_ms: u32,
7016 #[doc = "Bitmap for state of buttons."]
7017 pub state: u8,
7018}
7019impl BUTTON_CHANGE_DATA {
7020 pub const ENCODED_LEN: usize = 9usize;
7021 pub const DEFAULT: Self = Self {
7022 time_boot_ms: 0_u32,
7023 last_change_ms: 0_u32,
7024 state: 0_u8,
7025 };
7026 #[cfg(feature = "arbitrary")]
7027 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7028 use arbitrary::{Arbitrary, Unstructured};
7029 let mut buf = [0u8; 1024];
7030 rng.fill_bytes(&mut buf);
7031 let mut unstructured = Unstructured::new(&buf);
7032 Self::arbitrary(&mut unstructured).unwrap_or_default()
7033 }
7034}
7035impl Default for BUTTON_CHANGE_DATA {
7036 fn default() -> Self {
7037 Self::DEFAULT.clone()
7038 }
7039}
7040impl MessageData for BUTTON_CHANGE_DATA {
7041 type Message = MavMessage;
7042 const ID: u32 = 257u32;
7043 const NAME: &'static str = "BUTTON_CHANGE";
7044 const EXTRA_CRC: u8 = 131u8;
7045 const ENCODED_LEN: usize = 9usize;
7046 fn deser(
7047 _version: MavlinkVersion,
7048 __input: &[u8],
7049 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7050 let avail_len = __input.len();
7051 let mut payload_buf = [0; Self::ENCODED_LEN];
7052 let mut buf = if avail_len < Self::ENCODED_LEN {
7053 payload_buf[0..avail_len].copy_from_slice(__input);
7054 Bytes::new(&payload_buf)
7055 } else {
7056 Bytes::new(__input)
7057 };
7058 let mut __struct = Self::default();
7059 __struct.time_boot_ms = buf.get_u32_le();
7060 __struct.last_change_ms = buf.get_u32_le();
7061 __struct.state = buf.get_u8();
7062 Ok(__struct)
7063 }
7064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7065 let mut __tmp = BytesMut::new(bytes);
7066 #[allow(clippy::absurd_extreme_comparisons)]
7067 #[allow(unused_comparisons)]
7068 if __tmp.remaining() < Self::ENCODED_LEN {
7069 panic!(
7070 "buffer is too small (need {} bytes, but got {})",
7071 Self::ENCODED_LEN,
7072 __tmp.remaining(),
7073 )
7074 }
7075 __tmp.put_u32_le(self.time_boot_ms);
7076 __tmp.put_u32_le(self.last_change_ms);
7077 __tmp.put_u8(self.state);
7078 if matches!(version, MavlinkVersion::V2) {
7079 let len = __tmp.len();
7080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7081 } else {
7082 __tmp.len()
7083 }
7084 }
7085}
7086#[doc = "id: 262"]
7087#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7088#[derive(Debug, Clone, PartialEq)]
7089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7091pub struct CAMERA_CAPTURE_STATUS_DATA {
7092 #[doc = "Timestamp (time since system boot)."]
7093 pub time_boot_ms: u32,
7094 #[doc = "Image capture interval"]
7095 pub image_interval: f32,
7096 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7097 pub recording_time_ms: u32,
7098 #[doc = "Available storage capacity."]
7099 pub available_capacity: f32,
7100 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7101 pub image_status: u8,
7102 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7103 pub video_status: u8,
7104 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7105 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7106 pub image_count: i32,
7107 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7109 pub camera_device_id: u8,
7110}
7111impl CAMERA_CAPTURE_STATUS_DATA {
7112 pub const ENCODED_LEN: usize = 23usize;
7113 pub const DEFAULT: Self = Self {
7114 time_boot_ms: 0_u32,
7115 image_interval: 0.0_f32,
7116 recording_time_ms: 0_u32,
7117 available_capacity: 0.0_f32,
7118 image_status: 0_u8,
7119 video_status: 0_u8,
7120 image_count: 0_i32,
7121 camera_device_id: 0_u8,
7122 };
7123 #[cfg(feature = "arbitrary")]
7124 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7125 use arbitrary::{Arbitrary, Unstructured};
7126 let mut buf = [0u8; 1024];
7127 rng.fill_bytes(&mut buf);
7128 let mut unstructured = Unstructured::new(&buf);
7129 Self::arbitrary(&mut unstructured).unwrap_or_default()
7130 }
7131}
7132impl Default for CAMERA_CAPTURE_STATUS_DATA {
7133 fn default() -> Self {
7134 Self::DEFAULT.clone()
7135 }
7136}
7137impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7138 type Message = MavMessage;
7139 const ID: u32 = 262u32;
7140 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7141 const EXTRA_CRC: u8 = 12u8;
7142 const ENCODED_LEN: usize = 23usize;
7143 fn deser(
7144 _version: MavlinkVersion,
7145 __input: &[u8],
7146 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7147 let avail_len = __input.len();
7148 let mut payload_buf = [0; Self::ENCODED_LEN];
7149 let mut buf = if avail_len < Self::ENCODED_LEN {
7150 payload_buf[0..avail_len].copy_from_slice(__input);
7151 Bytes::new(&payload_buf)
7152 } else {
7153 Bytes::new(__input)
7154 };
7155 let mut __struct = Self::default();
7156 __struct.time_boot_ms = buf.get_u32_le();
7157 __struct.image_interval = buf.get_f32_le();
7158 __struct.recording_time_ms = buf.get_u32_le();
7159 __struct.available_capacity = buf.get_f32_le();
7160 __struct.image_status = buf.get_u8();
7161 __struct.video_status = buf.get_u8();
7162 __struct.image_count = buf.get_i32_le();
7163 __struct.camera_device_id = buf.get_u8();
7164 Ok(__struct)
7165 }
7166 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7167 let mut __tmp = BytesMut::new(bytes);
7168 #[allow(clippy::absurd_extreme_comparisons)]
7169 #[allow(unused_comparisons)]
7170 if __tmp.remaining() < Self::ENCODED_LEN {
7171 panic!(
7172 "buffer is too small (need {} bytes, but got {})",
7173 Self::ENCODED_LEN,
7174 __tmp.remaining(),
7175 )
7176 }
7177 __tmp.put_u32_le(self.time_boot_ms);
7178 __tmp.put_f32_le(self.image_interval);
7179 __tmp.put_u32_le(self.recording_time_ms);
7180 __tmp.put_f32_le(self.available_capacity);
7181 __tmp.put_u8(self.image_status);
7182 __tmp.put_u8(self.video_status);
7183 __tmp.put_i32_le(self.image_count);
7184 __tmp.put_u8(self.camera_device_id);
7185 if matches!(version, MavlinkVersion::V2) {
7186 let len = __tmp.len();
7187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7188 } else {
7189 __tmp.len()
7190 }
7191 }
7192}
7193#[doc = "id: 271"]
7194#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7195#[derive(Debug, Clone, PartialEq)]
7196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7198pub struct CAMERA_FOV_STATUS_DATA {
7199 #[doc = "Timestamp (time since system boot)."]
7200 pub time_boot_ms: u32,
7201 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7202 pub lat_camera: i32,
7203 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7204 pub lon_camera: i32,
7205 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7206 pub alt_camera: i32,
7207 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7208 pub lat_image: i32,
7209 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7210 pub lon_image: i32,
7211 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7212 pub alt_image: i32,
7213 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7215 pub q: [f32; 4],
7216 #[doc = "Horizontal field of view (NaN if unknown)."]
7217 pub hfov: f32,
7218 #[doc = "Vertical field of view (NaN if unknown)."]
7219 pub vfov: f32,
7220 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7221 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7222 pub camera_device_id: u8,
7223}
7224impl CAMERA_FOV_STATUS_DATA {
7225 pub const ENCODED_LEN: usize = 53usize;
7226 pub const DEFAULT: Self = Self {
7227 time_boot_ms: 0_u32,
7228 lat_camera: 0_i32,
7229 lon_camera: 0_i32,
7230 alt_camera: 0_i32,
7231 lat_image: 0_i32,
7232 lon_image: 0_i32,
7233 alt_image: 0_i32,
7234 q: [0.0_f32; 4usize],
7235 hfov: 0.0_f32,
7236 vfov: 0.0_f32,
7237 camera_device_id: 0_u8,
7238 };
7239 #[cfg(feature = "arbitrary")]
7240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7241 use arbitrary::{Arbitrary, Unstructured};
7242 let mut buf = [0u8; 1024];
7243 rng.fill_bytes(&mut buf);
7244 let mut unstructured = Unstructured::new(&buf);
7245 Self::arbitrary(&mut unstructured).unwrap_or_default()
7246 }
7247}
7248impl Default for CAMERA_FOV_STATUS_DATA {
7249 fn default() -> Self {
7250 Self::DEFAULT.clone()
7251 }
7252}
7253impl MessageData for CAMERA_FOV_STATUS_DATA {
7254 type Message = MavMessage;
7255 const ID: u32 = 271u32;
7256 const NAME: &'static str = "CAMERA_FOV_STATUS";
7257 const EXTRA_CRC: u8 = 22u8;
7258 const ENCODED_LEN: usize = 53usize;
7259 fn deser(
7260 _version: MavlinkVersion,
7261 __input: &[u8],
7262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7263 let avail_len = __input.len();
7264 let mut payload_buf = [0; Self::ENCODED_LEN];
7265 let mut buf = if avail_len < Self::ENCODED_LEN {
7266 payload_buf[0..avail_len].copy_from_slice(__input);
7267 Bytes::new(&payload_buf)
7268 } else {
7269 Bytes::new(__input)
7270 };
7271 let mut __struct = Self::default();
7272 __struct.time_boot_ms = buf.get_u32_le();
7273 __struct.lat_camera = buf.get_i32_le();
7274 __struct.lon_camera = buf.get_i32_le();
7275 __struct.alt_camera = buf.get_i32_le();
7276 __struct.lat_image = buf.get_i32_le();
7277 __struct.lon_image = buf.get_i32_le();
7278 __struct.alt_image = buf.get_i32_le();
7279 for v in &mut __struct.q {
7280 let val = buf.get_f32_le();
7281 *v = val;
7282 }
7283 __struct.hfov = buf.get_f32_le();
7284 __struct.vfov = buf.get_f32_le();
7285 __struct.camera_device_id = buf.get_u8();
7286 Ok(__struct)
7287 }
7288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7289 let mut __tmp = BytesMut::new(bytes);
7290 #[allow(clippy::absurd_extreme_comparisons)]
7291 #[allow(unused_comparisons)]
7292 if __tmp.remaining() < Self::ENCODED_LEN {
7293 panic!(
7294 "buffer is too small (need {} bytes, but got {})",
7295 Self::ENCODED_LEN,
7296 __tmp.remaining(),
7297 )
7298 }
7299 __tmp.put_u32_le(self.time_boot_ms);
7300 __tmp.put_i32_le(self.lat_camera);
7301 __tmp.put_i32_le(self.lon_camera);
7302 __tmp.put_i32_le(self.alt_camera);
7303 __tmp.put_i32_le(self.lat_image);
7304 __tmp.put_i32_le(self.lon_image);
7305 __tmp.put_i32_le(self.alt_image);
7306 for val in &self.q {
7307 __tmp.put_f32_le(*val);
7308 }
7309 __tmp.put_f32_le(self.hfov);
7310 __tmp.put_f32_le(self.vfov);
7311 __tmp.put_u8(self.camera_device_id);
7312 if matches!(version, MavlinkVersion::V2) {
7313 let len = __tmp.len();
7314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7315 } else {
7316 __tmp.len()
7317 }
7318 }
7319}
7320#[doc = "id: 263"]
7321#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7322#[derive(Debug, Clone, PartialEq)]
7323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7325pub struct CAMERA_IMAGE_CAPTURED_DATA {
7326 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7327 pub time_utc: u64,
7328 #[doc = "Timestamp (time since system boot)."]
7329 pub time_boot_ms: u32,
7330 #[doc = "Latitude where image was taken"]
7331 pub lat: i32,
7332 #[doc = "Longitude where capture was taken"]
7333 pub lon: i32,
7334 #[doc = "Altitude (MSL) where image was taken"]
7335 pub alt: i32,
7336 #[doc = "Altitude above ground"]
7337 pub relative_alt: i32,
7338 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7340 pub q: [f32; 4],
7341 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7342 pub image_index: i32,
7343 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7344 pub camera_id: u8,
7345 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7346 pub capture_result: i8,
7347 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7348 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7349 pub file_url: [u8; 205],
7350}
7351impl CAMERA_IMAGE_CAPTURED_DATA {
7352 pub const ENCODED_LEN: usize = 255usize;
7353 pub const DEFAULT: Self = Self {
7354 time_utc: 0_u64,
7355 time_boot_ms: 0_u32,
7356 lat: 0_i32,
7357 lon: 0_i32,
7358 alt: 0_i32,
7359 relative_alt: 0_i32,
7360 q: [0.0_f32; 4usize],
7361 image_index: 0_i32,
7362 camera_id: 0_u8,
7363 capture_result: 0_i8,
7364 file_url: [0_u8; 205usize],
7365 };
7366 #[cfg(feature = "arbitrary")]
7367 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7368 use arbitrary::{Arbitrary, Unstructured};
7369 let mut buf = [0u8; 1024];
7370 rng.fill_bytes(&mut buf);
7371 let mut unstructured = Unstructured::new(&buf);
7372 Self::arbitrary(&mut unstructured).unwrap_or_default()
7373 }
7374}
7375impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7376 fn default() -> Self {
7377 Self::DEFAULT.clone()
7378 }
7379}
7380impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7381 type Message = MavMessage;
7382 const ID: u32 = 263u32;
7383 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7384 const EXTRA_CRC: u8 = 133u8;
7385 const ENCODED_LEN: usize = 255usize;
7386 fn deser(
7387 _version: MavlinkVersion,
7388 __input: &[u8],
7389 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7390 let avail_len = __input.len();
7391 let mut payload_buf = [0; Self::ENCODED_LEN];
7392 let mut buf = if avail_len < Self::ENCODED_LEN {
7393 payload_buf[0..avail_len].copy_from_slice(__input);
7394 Bytes::new(&payload_buf)
7395 } else {
7396 Bytes::new(__input)
7397 };
7398 let mut __struct = Self::default();
7399 __struct.time_utc = buf.get_u64_le();
7400 __struct.time_boot_ms = buf.get_u32_le();
7401 __struct.lat = buf.get_i32_le();
7402 __struct.lon = buf.get_i32_le();
7403 __struct.alt = buf.get_i32_le();
7404 __struct.relative_alt = buf.get_i32_le();
7405 for v in &mut __struct.q {
7406 let val = buf.get_f32_le();
7407 *v = val;
7408 }
7409 __struct.image_index = buf.get_i32_le();
7410 __struct.camera_id = buf.get_u8();
7411 __struct.capture_result = buf.get_i8();
7412 for v in &mut __struct.file_url {
7413 let val = buf.get_u8();
7414 *v = val;
7415 }
7416 Ok(__struct)
7417 }
7418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7419 let mut __tmp = BytesMut::new(bytes);
7420 #[allow(clippy::absurd_extreme_comparisons)]
7421 #[allow(unused_comparisons)]
7422 if __tmp.remaining() < Self::ENCODED_LEN {
7423 panic!(
7424 "buffer is too small (need {} bytes, but got {})",
7425 Self::ENCODED_LEN,
7426 __tmp.remaining(),
7427 )
7428 }
7429 __tmp.put_u64_le(self.time_utc);
7430 __tmp.put_u32_le(self.time_boot_ms);
7431 __tmp.put_i32_le(self.lat);
7432 __tmp.put_i32_le(self.lon);
7433 __tmp.put_i32_le(self.alt);
7434 __tmp.put_i32_le(self.relative_alt);
7435 for val in &self.q {
7436 __tmp.put_f32_le(*val);
7437 }
7438 __tmp.put_i32_le(self.image_index);
7439 __tmp.put_u8(self.camera_id);
7440 __tmp.put_i8(self.capture_result);
7441 for val in &self.file_url {
7442 __tmp.put_u8(*val);
7443 }
7444 if matches!(version, MavlinkVersion::V2) {
7445 let len = __tmp.len();
7446 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7447 } else {
7448 __tmp.len()
7449 }
7450 }
7451}
7452#[doc = "id: 259"]
7453#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7454#[derive(Debug, Clone, PartialEq)]
7455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7457pub struct CAMERA_INFORMATION_DATA {
7458 #[doc = "Timestamp (time since system boot)."]
7459 pub time_boot_ms: u32,
7460 #[doc = "0xff). Use 0 if not known."]
7461 pub firmware_version: u32,
7462 #[doc = "Focal length. Use NaN if not known."]
7463 pub focal_length: f32,
7464 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7465 pub sensor_size_h: f32,
7466 #[doc = "Image sensor size vertical. Use NaN if not known."]
7467 pub sensor_size_v: f32,
7468 #[doc = "Bitmap of camera capability flags."]
7469 pub flags: CameraCapFlags,
7470 #[doc = "Horizontal image resolution. Use 0 if not known."]
7471 pub resolution_h: u16,
7472 #[doc = "Vertical image resolution. Use 0 if not known."]
7473 pub resolution_v: u16,
7474 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7475 pub cam_definition_version: u16,
7476 #[doc = "Name of the camera vendor"]
7477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7478 pub vendor_name: [u8; 32],
7479 #[doc = "Name of the camera model"]
7480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7481 pub model_name: [u8; 32],
7482 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7483 pub lens_id: u8,
7484 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7486 pub cam_definition_uri: [u8; 140],
7487 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7489 pub gimbal_device_id: u8,
7490 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7492 pub camera_device_id: u8,
7493}
7494impl CAMERA_INFORMATION_DATA {
7495 pub const ENCODED_LEN: usize = 237usize;
7496 pub const DEFAULT: Self = Self {
7497 time_boot_ms: 0_u32,
7498 firmware_version: 0_u32,
7499 focal_length: 0.0_f32,
7500 sensor_size_h: 0.0_f32,
7501 sensor_size_v: 0.0_f32,
7502 flags: CameraCapFlags::DEFAULT,
7503 resolution_h: 0_u16,
7504 resolution_v: 0_u16,
7505 cam_definition_version: 0_u16,
7506 vendor_name: [0_u8; 32usize],
7507 model_name: [0_u8; 32usize],
7508 lens_id: 0_u8,
7509 cam_definition_uri: [0_u8; 140usize],
7510 gimbal_device_id: 0_u8,
7511 camera_device_id: 0_u8,
7512 };
7513 #[cfg(feature = "arbitrary")]
7514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7515 use arbitrary::{Arbitrary, Unstructured};
7516 let mut buf = [0u8; 1024];
7517 rng.fill_bytes(&mut buf);
7518 let mut unstructured = Unstructured::new(&buf);
7519 Self::arbitrary(&mut unstructured).unwrap_or_default()
7520 }
7521}
7522impl Default for CAMERA_INFORMATION_DATA {
7523 fn default() -> Self {
7524 Self::DEFAULT.clone()
7525 }
7526}
7527impl MessageData for CAMERA_INFORMATION_DATA {
7528 type Message = MavMessage;
7529 const ID: u32 = 259u32;
7530 const NAME: &'static str = "CAMERA_INFORMATION";
7531 const EXTRA_CRC: u8 = 92u8;
7532 const ENCODED_LEN: usize = 237usize;
7533 fn deser(
7534 _version: MavlinkVersion,
7535 __input: &[u8],
7536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7537 let avail_len = __input.len();
7538 let mut payload_buf = [0; Self::ENCODED_LEN];
7539 let mut buf = if avail_len < Self::ENCODED_LEN {
7540 payload_buf[0..avail_len].copy_from_slice(__input);
7541 Bytes::new(&payload_buf)
7542 } else {
7543 Bytes::new(__input)
7544 };
7545 let mut __struct = Self::default();
7546 __struct.time_boot_ms = buf.get_u32_le();
7547 __struct.firmware_version = buf.get_u32_le();
7548 __struct.focal_length = buf.get_f32_le();
7549 __struct.sensor_size_h = buf.get_f32_le();
7550 __struct.sensor_size_v = buf.get_f32_le();
7551 let tmp = buf.get_u32_le();
7552 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7553 ::mavlink_core::error::ParserError::InvalidFlag {
7554 flag_type: "CameraCapFlags",
7555 value: tmp as u32,
7556 },
7557 )?;
7558 __struct.resolution_h = buf.get_u16_le();
7559 __struct.resolution_v = buf.get_u16_le();
7560 __struct.cam_definition_version = buf.get_u16_le();
7561 for v in &mut __struct.vendor_name {
7562 let val = buf.get_u8();
7563 *v = val;
7564 }
7565 for v in &mut __struct.model_name {
7566 let val = buf.get_u8();
7567 *v = val;
7568 }
7569 __struct.lens_id = buf.get_u8();
7570 for v in &mut __struct.cam_definition_uri {
7571 let val = buf.get_u8();
7572 *v = val;
7573 }
7574 __struct.gimbal_device_id = buf.get_u8();
7575 __struct.camera_device_id = buf.get_u8();
7576 Ok(__struct)
7577 }
7578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7579 let mut __tmp = BytesMut::new(bytes);
7580 #[allow(clippy::absurd_extreme_comparisons)]
7581 #[allow(unused_comparisons)]
7582 if __tmp.remaining() < Self::ENCODED_LEN {
7583 panic!(
7584 "buffer is too small (need {} bytes, but got {})",
7585 Self::ENCODED_LEN,
7586 __tmp.remaining(),
7587 )
7588 }
7589 __tmp.put_u32_le(self.time_boot_ms);
7590 __tmp.put_u32_le(self.firmware_version);
7591 __tmp.put_f32_le(self.focal_length);
7592 __tmp.put_f32_le(self.sensor_size_h);
7593 __tmp.put_f32_le(self.sensor_size_v);
7594 __tmp.put_u32_le(self.flags.bits());
7595 __tmp.put_u16_le(self.resolution_h);
7596 __tmp.put_u16_le(self.resolution_v);
7597 __tmp.put_u16_le(self.cam_definition_version);
7598 for val in &self.vendor_name {
7599 __tmp.put_u8(*val);
7600 }
7601 for val in &self.model_name {
7602 __tmp.put_u8(*val);
7603 }
7604 __tmp.put_u8(self.lens_id);
7605 for val in &self.cam_definition_uri {
7606 __tmp.put_u8(*val);
7607 }
7608 __tmp.put_u8(self.gimbal_device_id);
7609 __tmp.put_u8(self.camera_device_id);
7610 if matches!(version, MavlinkVersion::V2) {
7611 let len = __tmp.len();
7612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7613 } else {
7614 __tmp.len()
7615 }
7616 }
7617}
7618#[doc = "id: 260"]
7619#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7620#[derive(Debug, Clone, PartialEq)]
7621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7623pub struct CAMERA_SETTINGS_DATA {
7624 #[doc = "Timestamp (time since system boot)."]
7625 pub time_boot_ms: u32,
7626 #[doc = "Camera mode"]
7627 pub mode_id: CameraMode,
7628 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7629 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7630 pub zoomLevel: f32,
7631 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7633 pub focusLevel: f32,
7634 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7636 pub camera_device_id: u8,
7637}
7638impl CAMERA_SETTINGS_DATA {
7639 pub const ENCODED_LEN: usize = 14usize;
7640 pub const DEFAULT: Self = Self {
7641 time_boot_ms: 0_u32,
7642 mode_id: CameraMode::DEFAULT,
7643 zoomLevel: 0.0_f32,
7644 focusLevel: 0.0_f32,
7645 camera_device_id: 0_u8,
7646 };
7647 #[cfg(feature = "arbitrary")]
7648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7649 use arbitrary::{Arbitrary, Unstructured};
7650 let mut buf = [0u8; 1024];
7651 rng.fill_bytes(&mut buf);
7652 let mut unstructured = Unstructured::new(&buf);
7653 Self::arbitrary(&mut unstructured).unwrap_or_default()
7654 }
7655}
7656impl Default for CAMERA_SETTINGS_DATA {
7657 fn default() -> Self {
7658 Self::DEFAULT.clone()
7659 }
7660}
7661impl MessageData for CAMERA_SETTINGS_DATA {
7662 type Message = MavMessage;
7663 const ID: u32 = 260u32;
7664 const NAME: &'static str = "CAMERA_SETTINGS";
7665 const EXTRA_CRC: u8 = 146u8;
7666 const ENCODED_LEN: usize = 14usize;
7667 fn deser(
7668 _version: MavlinkVersion,
7669 __input: &[u8],
7670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7671 let avail_len = __input.len();
7672 let mut payload_buf = [0; Self::ENCODED_LEN];
7673 let mut buf = if avail_len < Self::ENCODED_LEN {
7674 payload_buf[0..avail_len].copy_from_slice(__input);
7675 Bytes::new(&payload_buf)
7676 } else {
7677 Bytes::new(__input)
7678 };
7679 let mut __struct = Self::default();
7680 __struct.time_boot_ms = buf.get_u32_le();
7681 let tmp = buf.get_u8();
7682 __struct.mode_id =
7683 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7684 enum_type: "CameraMode",
7685 value: tmp as u32,
7686 })?;
7687 __struct.zoomLevel = buf.get_f32_le();
7688 __struct.focusLevel = buf.get_f32_le();
7689 __struct.camera_device_id = buf.get_u8();
7690 Ok(__struct)
7691 }
7692 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7693 let mut __tmp = BytesMut::new(bytes);
7694 #[allow(clippy::absurd_extreme_comparisons)]
7695 #[allow(unused_comparisons)]
7696 if __tmp.remaining() < Self::ENCODED_LEN {
7697 panic!(
7698 "buffer is too small (need {} bytes, but got {})",
7699 Self::ENCODED_LEN,
7700 __tmp.remaining(),
7701 )
7702 }
7703 __tmp.put_u32_le(self.time_boot_ms);
7704 __tmp.put_u8(self.mode_id as u8);
7705 __tmp.put_f32_le(self.zoomLevel);
7706 __tmp.put_f32_le(self.focusLevel);
7707 __tmp.put_u8(self.camera_device_id);
7708 if matches!(version, MavlinkVersion::V2) {
7709 let len = __tmp.len();
7710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7711 } else {
7712 __tmp.len()
7713 }
7714 }
7715}
7716#[doc = "id: 277"]
7717#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7718#[derive(Debug, Clone, PartialEq)]
7719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7721pub struct CAMERA_THERMAL_RANGE_DATA {
7722 #[doc = "Timestamp (time since system boot)."]
7723 pub time_boot_ms: u32,
7724 #[doc = "Temperature max."]
7725 pub max: f32,
7726 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7727 pub max_point_x: f32,
7728 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7729 pub max_point_y: f32,
7730 #[doc = "Temperature min."]
7731 pub min: f32,
7732 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7733 pub min_point_x: f32,
7734 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7735 pub min_point_y: f32,
7736 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7737 pub stream_id: u8,
7738 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7739 pub camera_device_id: u8,
7740}
7741impl CAMERA_THERMAL_RANGE_DATA {
7742 pub const ENCODED_LEN: usize = 30usize;
7743 pub const DEFAULT: Self = Self {
7744 time_boot_ms: 0_u32,
7745 max: 0.0_f32,
7746 max_point_x: 0.0_f32,
7747 max_point_y: 0.0_f32,
7748 min: 0.0_f32,
7749 min_point_x: 0.0_f32,
7750 min_point_y: 0.0_f32,
7751 stream_id: 0_u8,
7752 camera_device_id: 0_u8,
7753 };
7754 #[cfg(feature = "arbitrary")]
7755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7756 use arbitrary::{Arbitrary, Unstructured};
7757 let mut buf = [0u8; 1024];
7758 rng.fill_bytes(&mut buf);
7759 let mut unstructured = Unstructured::new(&buf);
7760 Self::arbitrary(&mut unstructured).unwrap_or_default()
7761 }
7762}
7763impl Default for CAMERA_THERMAL_RANGE_DATA {
7764 fn default() -> Self {
7765 Self::DEFAULT.clone()
7766 }
7767}
7768impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7769 type Message = MavMessage;
7770 const ID: u32 = 277u32;
7771 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7772 const EXTRA_CRC: u8 = 62u8;
7773 const ENCODED_LEN: usize = 30usize;
7774 fn deser(
7775 _version: MavlinkVersion,
7776 __input: &[u8],
7777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7778 let avail_len = __input.len();
7779 let mut payload_buf = [0; Self::ENCODED_LEN];
7780 let mut buf = if avail_len < Self::ENCODED_LEN {
7781 payload_buf[0..avail_len].copy_from_slice(__input);
7782 Bytes::new(&payload_buf)
7783 } else {
7784 Bytes::new(__input)
7785 };
7786 let mut __struct = Self::default();
7787 __struct.time_boot_ms = buf.get_u32_le();
7788 __struct.max = buf.get_f32_le();
7789 __struct.max_point_x = buf.get_f32_le();
7790 __struct.max_point_y = buf.get_f32_le();
7791 __struct.min = buf.get_f32_le();
7792 __struct.min_point_x = buf.get_f32_le();
7793 __struct.min_point_y = buf.get_f32_le();
7794 __struct.stream_id = buf.get_u8();
7795 __struct.camera_device_id = buf.get_u8();
7796 Ok(__struct)
7797 }
7798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7799 let mut __tmp = BytesMut::new(bytes);
7800 #[allow(clippy::absurd_extreme_comparisons)]
7801 #[allow(unused_comparisons)]
7802 if __tmp.remaining() < Self::ENCODED_LEN {
7803 panic!(
7804 "buffer is too small (need {} bytes, but got {})",
7805 Self::ENCODED_LEN,
7806 __tmp.remaining(),
7807 )
7808 }
7809 __tmp.put_u32_le(self.time_boot_ms);
7810 __tmp.put_f32_le(self.max);
7811 __tmp.put_f32_le(self.max_point_x);
7812 __tmp.put_f32_le(self.max_point_y);
7813 __tmp.put_f32_le(self.min);
7814 __tmp.put_f32_le(self.min_point_x);
7815 __tmp.put_f32_le(self.min_point_y);
7816 __tmp.put_u8(self.stream_id);
7817 __tmp.put_u8(self.camera_device_id);
7818 if matches!(version, MavlinkVersion::V2) {
7819 let len = __tmp.len();
7820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7821 } else {
7822 __tmp.len()
7823 }
7824 }
7825}
7826#[doc = "id: 276"]
7827#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7828#[derive(Debug, Clone, PartialEq)]
7829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7831pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7832 #[doc = "Latitude of tracked object"]
7833 pub lat: i32,
7834 #[doc = "Longitude of tracked object"]
7835 pub lon: i32,
7836 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7837 pub alt: f32,
7838 #[doc = "Horizontal accuracy. NAN if unknown"]
7839 pub h_acc: f32,
7840 #[doc = "Vertical accuracy. NAN if unknown"]
7841 pub v_acc: f32,
7842 #[doc = "North velocity of tracked object. NAN if unknown"]
7843 pub vel_n: f32,
7844 #[doc = "East velocity of tracked object. NAN if unknown"]
7845 pub vel_e: f32,
7846 #[doc = "Down velocity of tracked object. NAN if unknown"]
7847 pub vel_d: f32,
7848 #[doc = "Velocity accuracy. NAN if unknown"]
7849 pub vel_acc: f32,
7850 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7851 pub dist: f32,
7852 #[doc = "Heading in radians, in NED. NAN if unknown"]
7853 pub hdg: f32,
7854 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7855 pub hdg_acc: f32,
7856 #[doc = "Current tracking status"]
7857 pub tracking_status: CameraTrackingStatusFlags,
7858 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7859 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7860 pub camera_device_id: u8,
7861}
7862impl CAMERA_TRACKING_GEO_STATUS_DATA {
7863 pub const ENCODED_LEN: usize = 50usize;
7864 pub const DEFAULT: Self = Self {
7865 lat: 0_i32,
7866 lon: 0_i32,
7867 alt: 0.0_f32,
7868 h_acc: 0.0_f32,
7869 v_acc: 0.0_f32,
7870 vel_n: 0.0_f32,
7871 vel_e: 0.0_f32,
7872 vel_d: 0.0_f32,
7873 vel_acc: 0.0_f32,
7874 dist: 0.0_f32,
7875 hdg: 0.0_f32,
7876 hdg_acc: 0.0_f32,
7877 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7878 camera_device_id: 0_u8,
7879 };
7880 #[cfg(feature = "arbitrary")]
7881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7882 use arbitrary::{Arbitrary, Unstructured};
7883 let mut buf = [0u8; 1024];
7884 rng.fill_bytes(&mut buf);
7885 let mut unstructured = Unstructured::new(&buf);
7886 Self::arbitrary(&mut unstructured).unwrap_or_default()
7887 }
7888}
7889impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7890 fn default() -> Self {
7891 Self::DEFAULT.clone()
7892 }
7893}
7894impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7895 type Message = MavMessage;
7896 const ID: u32 = 276u32;
7897 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7898 const EXTRA_CRC: u8 = 18u8;
7899 const ENCODED_LEN: usize = 50usize;
7900 fn deser(
7901 _version: MavlinkVersion,
7902 __input: &[u8],
7903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7904 let avail_len = __input.len();
7905 let mut payload_buf = [0; Self::ENCODED_LEN];
7906 let mut buf = if avail_len < Self::ENCODED_LEN {
7907 payload_buf[0..avail_len].copy_from_slice(__input);
7908 Bytes::new(&payload_buf)
7909 } else {
7910 Bytes::new(__input)
7911 };
7912 let mut __struct = Self::default();
7913 __struct.lat = buf.get_i32_le();
7914 __struct.lon = buf.get_i32_le();
7915 __struct.alt = buf.get_f32_le();
7916 __struct.h_acc = buf.get_f32_le();
7917 __struct.v_acc = buf.get_f32_le();
7918 __struct.vel_n = buf.get_f32_le();
7919 __struct.vel_e = buf.get_f32_le();
7920 __struct.vel_d = buf.get_f32_le();
7921 __struct.vel_acc = buf.get_f32_le();
7922 __struct.dist = buf.get_f32_le();
7923 __struct.hdg = buf.get_f32_le();
7924 __struct.hdg_acc = buf.get_f32_le();
7925 let tmp = buf.get_u8();
7926 __struct.tracking_status =
7927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7928 enum_type: "CameraTrackingStatusFlags",
7929 value: tmp as u32,
7930 })?;
7931 __struct.camera_device_id = buf.get_u8();
7932 Ok(__struct)
7933 }
7934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7935 let mut __tmp = BytesMut::new(bytes);
7936 #[allow(clippy::absurd_extreme_comparisons)]
7937 #[allow(unused_comparisons)]
7938 if __tmp.remaining() < Self::ENCODED_LEN {
7939 panic!(
7940 "buffer is too small (need {} bytes, but got {})",
7941 Self::ENCODED_LEN,
7942 __tmp.remaining(),
7943 )
7944 }
7945 __tmp.put_i32_le(self.lat);
7946 __tmp.put_i32_le(self.lon);
7947 __tmp.put_f32_le(self.alt);
7948 __tmp.put_f32_le(self.h_acc);
7949 __tmp.put_f32_le(self.v_acc);
7950 __tmp.put_f32_le(self.vel_n);
7951 __tmp.put_f32_le(self.vel_e);
7952 __tmp.put_f32_le(self.vel_d);
7953 __tmp.put_f32_le(self.vel_acc);
7954 __tmp.put_f32_le(self.dist);
7955 __tmp.put_f32_le(self.hdg);
7956 __tmp.put_f32_le(self.hdg_acc);
7957 __tmp.put_u8(self.tracking_status as u8);
7958 __tmp.put_u8(self.camera_device_id);
7959 if matches!(version, MavlinkVersion::V2) {
7960 let len = __tmp.len();
7961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7962 } else {
7963 __tmp.len()
7964 }
7965 }
7966}
7967#[doc = "id: 275"]
7968#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7969#[derive(Debug, Clone, PartialEq)]
7970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7972pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7973 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7974 pub point_x: f32,
7975 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7976 pub point_y: f32,
7977 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7978 pub radius: f32,
7979 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7980 pub rec_top_x: f32,
7981 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7982 pub rec_top_y: f32,
7983 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7984 pub rec_bottom_x: f32,
7985 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7986 pub rec_bottom_y: f32,
7987 #[doc = "Current tracking status"]
7988 pub tracking_status: CameraTrackingStatusFlags,
7989 #[doc = "Current tracking mode"]
7990 pub tracking_mode: CameraTrackingMode,
7991 #[doc = "Defines location of target data"]
7992 pub target_data: CameraTrackingTargetData,
7993 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7994 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7995 pub camera_device_id: u8,
7996}
7997impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7998 pub const ENCODED_LEN: usize = 32usize;
7999 pub const DEFAULT: Self = Self {
8000 point_x: 0.0_f32,
8001 point_y: 0.0_f32,
8002 radius: 0.0_f32,
8003 rec_top_x: 0.0_f32,
8004 rec_top_y: 0.0_f32,
8005 rec_bottom_x: 0.0_f32,
8006 rec_bottom_y: 0.0_f32,
8007 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8008 tracking_mode: CameraTrackingMode::DEFAULT,
8009 target_data: CameraTrackingTargetData::DEFAULT,
8010 camera_device_id: 0_u8,
8011 };
8012 #[cfg(feature = "arbitrary")]
8013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8014 use arbitrary::{Arbitrary, Unstructured};
8015 let mut buf = [0u8; 1024];
8016 rng.fill_bytes(&mut buf);
8017 let mut unstructured = Unstructured::new(&buf);
8018 Self::arbitrary(&mut unstructured).unwrap_or_default()
8019 }
8020}
8021impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8022 fn default() -> Self {
8023 Self::DEFAULT.clone()
8024 }
8025}
8026impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8027 type Message = MavMessage;
8028 const ID: u32 = 275u32;
8029 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8030 const EXTRA_CRC: u8 = 126u8;
8031 const ENCODED_LEN: usize = 32usize;
8032 fn deser(
8033 _version: MavlinkVersion,
8034 __input: &[u8],
8035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8036 let avail_len = __input.len();
8037 let mut payload_buf = [0; Self::ENCODED_LEN];
8038 let mut buf = if avail_len < Self::ENCODED_LEN {
8039 payload_buf[0..avail_len].copy_from_slice(__input);
8040 Bytes::new(&payload_buf)
8041 } else {
8042 Bytes::new(__input)
8043 };
8044 let mut __struct = Self::default();
8045 __struct.point_x = buf.get_f32_le();
8046 __struct.point_y = buf.get_f32_le();
8047 __struct.radius = buf.get_f32_le();
8048 __struct.rec_top_x = buf.get_f32_le();
8049 __struct.rec_top_y = buf.get_f32_le();
8050 __struct.rec_bottom_x = buf.get_f32_le();
8051 __struct.rec_bottom_y = buf.get_f32_le();
8052 let tmp = buf.get_u8();
8053 __struct.tracking_status =
8054 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8055 enum_type: "CameraTrackingStatusFlags",
8056 value: tmp as u32,
8057 })?;
8058 let tmp = buf.get_u8();
8059 __struct.tracking_mode =
8060 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8061 enum_type: "CameraTrackingMode",
8062 value: tmp as u32,
8063 })?;
8064 let tmp = buf.get_u8();
8065 __struct.target_data =
8066 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8067 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8068 flag_type: "CameraTrackingTargetData",
8069 value: tmp as u32,
8070 })?;
8071 __struct.camera_device_id = buf.get_u8();
8072 Ok(__struct)
8073 }
8074 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8075 let mut __tmp = BytesMut::new(bytes);
8076 #[allow(clippy::absurd_extreme_comparisons)]
8077 #[allow(unused_comparisons)]
8078 if __tmp.remaining() < Self::ENCODED_LEN {
8079 panic!(
8080 "buffer is too small (need {} bytes, but got {})",
8081 Self::ENCODED_LEN,
8082 __tmp.remaining(),
8083 )
8084 }
8085 __tmp.put_f32_le(self.point_x);
8086 __tmp.put_f32_le(self.point_y);
8087 __tmp.put_f32_le(self.radius);
8088 __tmp.put_f32_le(self.rec_top_x);
8089 __tmp.put_f32_le(self.rec_top_y);
8090 __tmp.put_f32_le(self.rec_bottom_x);
8091 __tmp.put_f32_le(self.rec_bottom_y);
8092 __tmp.put_u8(self.tracking_status as u8);
8093 __tmp.put_u8(self.tracking_mode as u8);
8094 __tmp.put_u8(self.target_data.bits());
8095 __tmp.put_u8(self.camera_device_id);
8096 if matches!(version, MavlinkVersion::V2) {
8097 let len = __tmp.len();
8098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8099 } else {
8100 __tmp.len()
8101 }
8102 }
8103}
8104#[doc = "id: 112"]
8105#[doc = "Camera-IMU triggering and synchronisation message."]
8106#[derive(Debug, Clone, PartialEq)]
8107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8109pub struct CAMERA_TRIGGER_DATA {
8110 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8111 pub time_usec: u64,
8112 #[doc = "Image frame sequence"]
8113 pub seq: u32,
8114}
8115impl CAMERA_TRIGGER_DATA {
8116 pub const ENCODED_LEN: usize = 12usize;
8117 pub const DEFAULT: Self = Self {
8118 time_usec: 0_u64,
8119 seq: 0_u32,
8120 };
8121 #[cfg(feature = "arbitrary")]
8122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8123 use arbitrary::{Arbitrary, Unstructured};
8124 let mut buf = [0u8; 1024];
8125 rng.fill_bytes(&mut buf);
8126 let mut unstructured = Unstructured::new(&buf);
8127 Self::arbitrary(&mut unstructured).unwrap_or_default()
8128 }
8129}
8130impl Default for CAMERA_TRIGGER_DATA {
8131 fn default() -> Self {
8132 Self::DEFAULT.clone()
8133 }
8134}
8135impl MessageData for CAMERA_TRIGGER_DATA {
8136 type Message = MavMessage;
8137 const ID: u32 = 112u32;
8138 const NAME: &'static str = "CAMERA_TRIGGER";
8139 const EXTRA_CRC: u8 = 174u8;
8140 const ENCODED_LEN: usize = 12usize;
8141 fn deser(
8142 _version: MavlinkVersion,
8143 __input: &[u8],
8144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8145 let avail_len = __input.len();
8146 let mut payload_buf = [0; Self::ENCODED_LEN];
8147 let mut buf = if avail_len < Self::ENCODED_LEN {
8148 payload_buf[0..avail_len].copy_from_slice(__input);
8149 Bytes::new(&payload_buf)
8150 } else {
8151 Bytes::new(__input)
8152 };
8153 let mut __struct = Self::default();
8154 __struct.time_usec = buf.get_u64_le();
8155 __struct.seq = buf.get_u32_le();
8156 Ok(__struct)
8157 }
8158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8159 let mut __tmp = BytesMut::new(bytes);
8160 #[allow(clippy::absurd_extreme_comparisons)]
8161 #[allow(unused_comparisons)]
8162 if __tmp.remaining() < Self::ENCODED_LEN {
8163 panic!(
8164 "buffer is too small (need {} bytes, but got {})",
8165 Self::ENCODED_LEN,
8166 __tmp.remaining(),
8167 )
8168 }
8169 __tmp.put_u64_le(self.time_usec);
8170 __tmp.put_u32_le(self.seq);
8171 if matches!(version, MavlinkVersion::V2) {
8172 let len = __tmp.len();
8173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8174 } else {
8175 __tmp.len()
8176 }
8177 }
8178}
8179#[doc = "id: 387"]
8180#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8181#[derive(Debug, Clone, PartialEq)]
8182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8184pub struct CANFD_FRAME_DATA {
8185 #[doc = "Frame ID"]
8186 pub id: u32,
8187 #[doc = "System ID."]
8188 pub target_system: u8,
8189 #[doc = "Component ID."]
8190 pub target_component: u8,
8191 #[doc = "bus number"]
8192 pub bus: u8,
8193 #[doc = "Frame length"]
8194 pub len: u8,
8195 #[doc = "Frame data"]
8196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8197 pub data: [u8; 64],
8198}
8199impl CANFD_FRAME_DATA {
8200 pub const ENCODED_LEN: usize = 72usize;
8201 pub const DEFAULT: Self = Self {
8202 id: 0_u32,
8203 target_system: 0_u8,
8204 target_component: 0_u8,
8205 bus: 0_u8,
8206 len: 0_u8,
8207 data: [0_u8; 64usize],
8208 };
8209 #[cfg(feature = "arbitrary")]
8210 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8211 use arbitrary::{Arbitrary, Unstructured};
8212 let mut buf = [0u8; 1024];
8213 rng.fill_bytes(&mut buf);
8214 let mut unstructured = Unstructured::new(&buf);
8215 Self::arbitrary(&mut unstructured).unwrap_or_default()
8216 }
8217}
8218impl Default for CANFD_FRAME_DATA {
8219 fn default() -> Self {
8220 Self::DEFAULT.clone()
8221 }
8222}
8223impl MessageData for CANFD_FRAME_DATA {
8224 type Message = MavMessage;
8225 const ID: u32 = 387u32;
8226 const NAME: &'static str = "CANFD_FRAME";
8227 const EXTRA_CRC: u8 = 4u8;
8228 const ENCODED_LEN: usize = 72usize;
8229 fn deser(
8230 _version: MavlinkVersion,
8231 __input: &[u8],
8232 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8233 let avail_len = __input.len();
8234 let mut payload_buf = [0; Self::ENCODED_LEN];
8235 let mut buf = if avail_len < Self::ENCODED_LEN {
8236 payload_buf[0..avail_len].copy_from_slice(__input);
8237 Bytes::new(&payload_buf)
8238 } else {
8239 Bytes::new(__input)
8240 };
8241 let mut __struct = Self::default();
8242 __struct.id = buf.get_u32_le();
8243 __struct.target_system = buf.get_u8();
8244 __struct.target_component = buf.get_u8();
8245 __struct.bus = buf.get_u8();
8246 __struct.len = buf.get_u8();
8247 for v in &mut __struct.data {
8248 let val = buf.get_u8();
8249 *v = val;
8250 }
8251 Ok(__struct)
8252 }
8253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8254 let mut __tmp = BytesMut::new(bytes);
8255 #[allow(clippy::absurd_extreme_comparisons)]
8256 #[allow(unused_comparisons)]
8257 if __tmp.remaining() < Self::ENCODED_LEN {
8258 panic!(
8259 "buffer is too small (need {} bytes, but got {})",
8260 Self::ENCODED_LEN,
8261 __tmp.remaining(),
8262 )
8263 }
8264 __tmp.put_u32_le(self.id);
8265 __tmp.put_u8(self.target_system);
8266 __tmp.put_u8(self.target_component);
8267 __tmp.put_u8(self.bus);
8268 __tmp.put_u8(self.len);
8269 for val in &self.data {
8270 __tmp.put_u8(*val);
8271 }
8272 if matches!(version, MavlinkVersion::V2) {
8273 let len = __tmp.len();
8274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8275 } else {
8276 __tmp.len()
8277 }
8278 }
8279}
8280#[doc = "id: 388"]
8281#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8282#[derive(Debug, Clone, PartialEq)]
8283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8285pub struct CAN_FILTER_MODIFY_DATA {
8286 #[doc = "filter IDs, length num_ids"]
8287 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8288 pub ids: [u16; 16],
8289 #[doc = "System ID."]
8290 pub target_system: u8,
8291 #[doc = "Component ID."]
8292 pub target_component: u8,
8293 #[doc = "bus number"]
8294 pub bus: u8,
8295 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8296 pub operation: CanFilterOp,
8297 #[doc = "number of IDs in filter list"]
8298 pub num_ids: u8,
8299}
8300impl CAN_FILTER_MODIFY_DATA {
8301 pub const ENCODED_LEN: usize = 37usize;
8302 pub const DEFAULT: Self = Self {
8303 ids: [0_u16; 16usize],
8304 target_system: 0_u8,
8305 target_component: 0_u8,
8306 bus: 0_u8,
8307 operation: CanFilterOp::DEFAULT,
8308 num_ids: 0_u8,
8309 };
8310 #[cfg(feature = "arbitrary")]
8311 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8312 use arbitrary::{Arbitrary, Unstructured};
8313 let mut buf = [0u8; 1024];
8314 rng.fill_bytes(&mut buf);
8315 let mut unstructured = Unstructured::new(&buf);
8316 Self::arbitrary(&mut unstructured).unwrap_or_default()
8317 }
8318}
8319impl Default for CAN_FILTER_MODIFY_DATA {
8320 fn default() -> Self {
8321 Self::DEFAULT.clone()
8322 }
8323}
8324impl MessageData for CAN_FILTER_MODIFY_DATA {
8325 type Message = MavMessage;
8326 const ID: u32 = 388u32;
8327 const NAME: &'static str = "CAN_FILTER_MODIFY";
8328 const EXTRA_CRC: u8 = 8u8;
8329 const ENCODED_LEN: usize = 37usize;
8330 fn deser(
8331 _version: MavlinkVersion,
8332 __input: &[u8],
8333 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8334 let avail_len = __input.len();
8335 let mut payload_buf = [0; Self::ENCODED_LEN];
8336 let mut buf = if avail_len < Self::ENCODED_LEN {
8337 payload_buf[0..avail_len].copy_from_slice(__input);
8338 Bytes::new(&payload_buf)
8339 } else {
8340 Bytes::new(__input)
8341 };
8342 let mut __struct = Self::default();
8343 for v in &mut __struct.ids {
8344 let val = buf.get_u16_le();
8345 *v = val;
8346 }
8347 __struct.target_system = buf.get_u8();
8348 __struct.target_component = buf.get_u8();
8349 __struct.bus = buf.get_u8();
8350 let tmp = buf.get_u8();
8351 __struct.operation =
8352 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8353 enum_type: "CanFilterOp",
8354 value: tmp as u32,
8355 })?;
8356 __struct.num_ids = buf.get_u8();
8357 Ok(__struct)
8358 }
8359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8360 let mut __tmp = BytesMut::new(bytes);
8361 #[allow(clippy::absurd_extreme_comparisons)]
8362 #[allow(unused_comparisons)]
8363 if __tmp.remaining() < Self::ENCODED_LEN {
8364 panic!(
8365 "buffer is too small (need {} bytes, but got {})",
8366 Self::ENCODED_LEN,
8367 __tmp.remaining(),
8368 )
8369 }
8370 for val in &self.ids {
8371 __tmp.put_u16_le(*val);
8372 }
8373 __tmp.put_u8(self.target_system);
8374 __tmp.put_u8(self.target_component);
8375 __tmp.put_u8(self.bus);
8376 __tmp.put_u8(self.operation as u8);
8377 __tmp.put_u8(self.num_ids);
8378 if matches!(version, MavlinkVersion::V2) {
8379 let len = __tmp.len();
8380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8381 } else {
8382 __tmp.len()
8383 }
8384 }
8385}
8386#[doc = "id: 386"]
8387#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8388#[derive(Debug, Clone, PartialEq)]
8389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8391pub struct CAN_FRAME_DATA {
8392 #[doc = "Frame ID"]
8393 pub id: u32,
8394 #[doc = "System ID."]
8395 pub target_system: u8,
8396 #[doc = "Component ID."]
8397 pub target_component: u8,
8398 #[doc = "Bus number"]
8399 pub bus: u8,
8400 #[doc = "Frame length"]
8401 pub len: u8,
8402 #[doc = "Frame data"]
8403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8404 pub data: [u8; 8],
8405}
8406impl CAN_FRAME_DATA {
8407 pub const ENCODED_LEN: usize = 16usize;
8408 pub const DEFAULT: Self = Self {
8409 id: 0_u32,
8410 target_system: 0_u8,
8411 target_component: 0_u8,
8412 bus: 0_u8,
8413 len: 0_u8,
8414 data: [0_u8; 8usize],
8415 };
8416 #[cfg(feature = "arbitrary")]
8417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8418 use arbitrary::{Arbitrary, Unstructured};
8419 let mut buf = [0u8; 1024];
8420 rng.fill_bytes(&mut buf);
8421 let mut unstructured = Unstructured::new(&buf);
8422 Self::arbitrary(&mut unstructured).unwrap_or_default()
8423 }
8424}
8425impl Default for CAN_FRAME_DATA {
8426 fn default() -> Self {
8427 Self::DEFAULT.clone()
8428 }
8429}
8430impl MessageData for CAN_FRAME_DATA {
8431 type Message = MavMessage;
8432 const ID: u32 = 386u32;
8433 const NAME: &'static str = "CAN_FRAME";
8434 const EXTRA_CRC: u8 = 132u8;
8435 const ENCODED_LEN: usize = 16usize;
8436 fn deser(
8437 _version: MavlinkVersion,
8438 __input: &[u8],
8439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8440 let avail_len = __input.len();
8441 let mut payload_buf = [0; Self::ENCODED_LEN];
8442 let mut buf = if avail_len < Self::ENCODED_LEN {
8443 payload_buf[0..avail_len].copy_from_slice(__input);
8444 Bytes::new(&payload_buf)
8445 } else {
8446 Bytes::new(__input)
8447 };
8448 let mut __struct = Self::default();
8449 __struct.id = buf.get_u32_le();
8450 __struct.target_system = buf.get_u8();
8451 __struct.target_component = buf.get_u8();
8452 __struct.bus = buf.get_u8();
8453 __struct.len = buf.get_u8();
8454 for v in &mut __struct.data {
8455 let val = buf.get_u8();
8456 *v = val;
8457 }
8458 Ok(__struct)
8459 }
8460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8461 let mut __tmp = BytesMut::new(bytes);
8462 #[allow(clippy::absurd_extreme_comparisons)]
8463 #[allow(unused_comparisons)]
8464 if __tmp.remaining() < Self::ENCODED_LEN {
8465 panic!(
8466 "buffer is too small (need {} bytes, but got {})",
8467 Self::ENCODED_LEN,
8468 __tmp.remaining(),
8469 )
8470 }
8471 __tmp.put_u32_le(self.id);
8472 __tmp.put_u8(self.target_system);
8473 __tmp.put_u8(self.target_component);
8474 __tmp.put_u8(self.bus);
8475 __tmp.put_u8(self.len);
8476 for val in &self.data {
8477 __tmp.put_u8(*val);
8478 }
8479 if matches!(version, MavlinkVersion::V2) {
8480 let len = __tmp.len();
8481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8482 } else {
8483 __tmp.len()
8484 }
8485 }
8486}
8487#[doc = "id: 336"]
8488#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8489#[derive(Debug, Clone, PartialEq)]
8490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8492pub struct CELLULAR_CONFIG_DATA {
8493 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8494 pub enable_lte: u8,
8495 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8496 pub enable_pin: u8,
8497 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8499 pub pin: [u8; 16],
8500 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8501 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8502 pub new_pin: [u8; 16],
8503 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8504 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8505 pub apn: [u8; 32],
8506 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8507 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8508 pub puk: [u8; 16],
8509 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8510 pub roaming: u8,
8511 #[doc = "Message acceptance response (sent back to GS)."]
8512 pub response: CellularConfigResponse,
8513}
8514impl CELLULAR_CONFIG_DATA {
8515 pub const ENCODED_LEN: usize = 84usize;
8516 pub const DEFAULT: Self = Self {
8517 enable_lte: 0_u8,
8518 enable_pin: 0_u8,
8519 pin: [0_u8; 16usize],
8520 new_pin: [0_u8; 16usize],
8521 apn: [0_u8; 32usize],
8522 puk: [0_u8; 16usize],
8523 roaming: 0_u8,
8524 response: CellularConfigResponse::DEFAULT,
8525 };
8526 #[cfg(feature = "arbitrary")]
8527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8528 use arbitrary::{Arbitrary, Unstructured};
8529 let mut buf = [0u8; 1024];
8530 rng.fill_bytes(&mut buf);
8531 let mut unstructured = Unstructured::new(&buf);
8532 Self::arbitrary(&mut unstructured).unwrap_or_default()
8533 }
8534}
8535impl Default for CELLULAR_CONFIG_DATA {
8536 fn default() -> Self {
8537 Self::DEFAULT.clone()
8538 }
8539}
8540impl MessageData for CELLULAR_CONFIG_DATA {
8541 type Message = MavMessage;
8542 const ID: u32 = 336u32;
8543 const NAME: &'static str = "CELLULAR_CONFIG";
8544 const EXTRA_CRC: u8 = 245u8;
8545 const ENCODED_LEN: usize = 84usize;
8546 fn deser(
8547 _version: MavlinkVersion,
8548 __input: &[u8],
8549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8550 let avail_len = __input.len();
8551 let mut payload_buf = [0; Self::ENCODED_LEN];
8552 let mut buf = if avail_len < Self::ENCODED_LEN {
8553 payload_buf[0..avail_len].copy_from_slice(__input);
8554 Bytes::new(&payload_buf)
8555 } else {
8556 Bytes::new(__input)
8557 };
8558 let mut __struct = Self::default();
8559 __struct.enable_lte = buf.get_u8();
8560 __struct.enable_pin = buf.get_u8();
8561 for v in &mut __struct.pin {
8562 let val = buf.get_u8();
8563 *v = val;
8564 }
8565 for v in &mut __struct.new_pin {
8566 let val = buf.get_u8();
8567 *v = val;
8568 }
8569 for v in &mut __struct.apn {
8570 let val = buf.get_u8();
8571 *v = val;
8572 }
8573 for v in &mut __struct.puk {
8574 let val = buf.get_u8();
8575 *v = val;
8576 }
8577 __struct.roaming = buf.get_u8();
8578 let tmp = buf.get_u8();
8579 __struct.response =
8580 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8581 enum_type: "CellularConfigResponse",
8582 value: tmp as u32,
8583 })?;
8584 Ok(__struct)
8585 }
8586 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8587 let mut __tmp = BytesMut::new(bytes);
8588 #[allow(clippy::absurd_extreme_comparisons)]
8589 #[allow(unused_comparisons)]
8590 if __tmp.remaining() < Self::ENCODED_LEN {
8591 panic!(
8592 "buffer is too small (need {} bytes, but got {})",
8593 Self::ENCODED_LEN,
8594 __tmp.remaining(),
8595 )
8596 }
8597 __tmp.put_u8(self.enable_lte);
8598 __tmp.put_u8(self.enable_pin);
8599 for val in &self.pin {
8600 __tmp.put_u8(*val);
8601 }
8602 for val in &self.new_pin {
8603 __tmp.put_u8(*val);
8604 }
8605 for val in &self.apn {
8606 __tmp.put_u8(*val);
8607 }
8608 for val in &self.puk {
8609 __tmp.put_u8(*val);
8610 }
8611 __tmp.put_u8(self.roaming);
8612 __tmp.put_u8(self.response as u8);
8613 if matches!(version, MavlinkVersion::V2) {
8614 let len = __tmp.len();
8615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8616 } else {
8617 __tmp.len()
8618 }
8619 }
8620}
8621#[doc = "id: 334"]
8622#[doc = "Report current used cellular network status."]
8623#[derive(Debug, Clone, PartialEq)]
8624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8626pub struct CELLULAR_STATUS_DATA {
8627 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8628 pub mcc: u16,
8629 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8630 pub mnc: u16,
8631 #[doc = "Location area code. If unknown, set to 0"]
8632 pub lac: u16,
8633 #[doc = "Cellular modem status"]
8634 pub status: CellularStatusFlag,
8635 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8636 pub failure_reason: CellularNetworkFailedReason,
8637 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8638 pub mavtype: CellularNetworkRadioType,
8639 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8640 pub quality: u8,
8641}
8642impl CELLULAR_STATUS_DATA {
8643 pub const ENCODED_LEN: usize = 10usize;
8644 pub const DEFAULT: Self = Self {
8645 mcc: 0_u16,
8646 mnc: 0_u16,
8647 lac: 0_u16,
8648 status: CellularStatusFlag::DEFAULT,
8649 failure_reason: CellularNetworkFailedReason::DEFAULT,
8650 mavtype: CellularNetworkRadioType::DEFAULT,
8651 quality: 0_u8,
8652 };
8653 #[cfg(feature = "arbitrary")]
8654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8655 use arbitrary::{Arbitrary, Unstructured};
8656 let mut buf = [0u8; 1024];
8657 rng.fill_bytes(&mut buf);
8658 let mut unstructured = Unstructured::new(&buf);
8659 Self::arbitrary(&mut unstructured).unwrap_or_default()
8660 }
8661}
8662impl Default for CELLULAR_STATUS_DATA {
8663 fn default() -> Self {
8664 Self::DEFAULT.clone()
8665 }
8666}
8667impl MessageData for CELLULAR_STATUS_DATA {
8668 type Message = MavMessage;
8669 const ID: u32 = 334u32;
8670 const NAME: &'static str = "CELLULAR_STATUS";
8671 const EXTRA_CRC: u8 = 72u8;
8672 const ENCODED_LEN: usize = 10usize;
8673 fn deser(
8674 _version: MavlinkVersion,
8675 __input: &[u8],
8676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8677 let avail_len = __input.len();
8678 let mut payload_buf = [0; Self::ENCODED_LEN];
8679 let mut buf = if avail_len < Self::ENCODED_LEN {
8680 payload_buf[0..avail_len].copy_from_slice(__input);
8681 Bytes::new(&payload_buf)
8682 } else {
8683 Bytes::new(__input)
8684 };
8685 let mut __struct = Self::default();
8686 __struct.mcc = buf.get_u16_le();
8687 __struct.mnc = buf.get_u16_le();
8688 __struct.lac = buf.get_u16_le();
8689 let tmp = buf.get_u8();
8690 __struct.status =
8691 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8692 enum_type: "CellularStatusFlag",
8693 value: tmp as u32,
8694 })?;
8695 let tmp = buf.get_u8();
8696 __struct.failure_reason =
8697 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8698 enum_type: "CellularNetworkFailedReason",
8699 value: tmp as u32,
8700 })?;
8701 let tmp = buf.get_u8();
8702 __struct.mavtype =
8703 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8704 enum_type: "CellularNetworkRadioType",
8705 value: tmp as u32,
8706 })?;
8707 __struct.quality = buf.get_u8();
8708 Ok(__struct)
8709 }
8710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8711 let mut __tmp = BytesMut::new(bytes);
8712 #[allow(clippy::absurd_extreme_comparisons)]
8713 #[allow(unused_comparisons)]
8714 if __tmp.remaining() < Self::ENCODED_LEN {
8715 panic!(
8716 "buffer is too small (need {} bytes, but got {})",
8717 Self::ENCODED_LEN,
8718 __tmp.remaining(),
8719 )
8720 }
8721 __tmp.put_u16_le(self.mcc);
8722 __tmp.put_u16_le(self.mnc);
8723 __tmp.put_u16_le(self.lac);
8724 __tmp.put_u8(self.status as u8);
8725 __tmp.put_u8(self.failure_reason as u8);
8726 __tmp.put_u8(self.mavtype as u8);
8727 __tmp.put_u8(self.quality);
8728 if matches!(version, MavlinkVersion::V2) {
8729 let len = __tmp.len();
8730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8731 } else {
8732 __tmp.len()
8733 }
8734 }
8735}
8736#[doc = "id: 5"]
8737#[doc = "Request to control this MAV."]
8738#[derive(Debug, Clone, PartialEq)]
8739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8741pub struct CHANGE_OPERATOR_CONTROL_DATA {
8742 #[doc = "System the GCS requests control for"]
8743 pub target_system: u8,
8744 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8745 pub control_request: u8,
8746 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8747 pub version: u8,
8748 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8749 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8750 pub passkey: [u8; 25],
8751}
8752impl CHANGE_OPERATOR_CONTROL_DATA {
8753 pub const ENCODED_LEN: usize = 28usize;
8754 pub const DEFAULT: Self = Self {
8755 target_system: 0_u8,
8756 control_request: 0_u8,
8757 version: 0_u8,
8758 passkey: [0_u8; 25usize],
8759 };
8760 #[cfg(feature = "arbitrary")]
8761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8762 use arbitrary::{Arbitrary, Unstructured};
8763 let mut buf = [0u8; 1024];
8764 rng.fill_bytes(&mut buf);
8765 let mut unstructured = Unstructured::new(&buf);
8766 Self::arbitrary(&mut unstructured).unwrap_or_default()
8767 }
8768}
8769impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8770 fn default() -> Self {
8771 Self::DEFAULT.clone()
8772 }
8773}
8774impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8775 type Message = MavMessage;
8776 const ID: u32 = 5u32;
8777 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8778 const EXTRA_CRC: u8 = 217u8;
8779 const ENCODED_LEN: usize = 28usize;
8780 fn deser(
8781 _version: MavlinkVersion,
8782 __input: &[u8],
8783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8784 let avail_len = __input.len();
8785 let mut payload_buf = [0; Self::ENCODED_LEN];
8786 let mut buf = if avail_len < Self::ENCODED_LEN {
8787 payload_buf[0..avail_len].copy_from_slice(__input);
8788 Bytes::new(&payload_buf)
8789 } else {
8790 Bytes::new(__input)
8791 };
8792 let mut __struct = Self::default();
8793 __struct.target_system = buf.get_u8();
8794 __struct.control_request = buf.get_u8();
8795 __struct.version = buf.get_u8();
8796 for v in &mut __struct.passkey {
8797 let val = buf.get_u8();
8798 *v = val;
8799 }
8800 Ok(__struct)
8801 }
8802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8803 let mut __tmp = BytesMut::new(bytes);
8804 #[allow(clippy::absurd_extreme_comparisons)]
8805 #[allow(unused_comparisons)]
8806 if __tmp.remaining() < Self::ENCODED_LEN {
8807 panic!(
8808 "buffer is too small (need {} bytes, but got {})",
8809 Self::ENCODED_LEN,
8810 __tmp.remaining(),
8811 )
8812 }
8813 __tmp.put_u8(self.target_system);
8814 __tmp.put_u8(self.control_request);
8815 __tmp.put_u8(self.version);
8816 for val in &self.passkey {
8817 __tmp.put_u8(*val);
8818 }
8819 if matches!(version, MavlinkVersion::V2) {
8820 let len = __tmp.len();
8821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8822 } else {
8823 __tmp.len()
8824 }
8825 }
8826}
8827#[doc = "id: 6"]
8828#[doc = "Accept / deny control of this MAV."]
8829#[derive(Debug, Clone, PartialEq)]
8830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8832pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8833 #[doc = "ID of the GCS this message"]
8834 pub gcs_system_id: u8,
8835 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8836 pub control_request: u8,
8837 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8838 pub ack: u8,
8839}
8840impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8841 pub const ENCODED_LEN: usize = 3usize;
8842 pub const DEFAULT: Self = Self {
8843 gcs_system_id: 0_u8,
8844 control_request: 0_u8,
8845 ack: 0_u8,
8846 };
8847 #[cfg(feature = "arbitrary")]
8848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8849 use arbitrary::{Arbitrary, Unstructured};
8850 let mut buf = [0u8; 1024];
8851 rng.fill_bytes(&mut buf);
8852 let mut unstructured = Unstructured::new(&buf);
8853 Self::arbitrary(&mut unstructured).unwrap_or_default()
8854 }
8855}
8856impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8857 fn default() -> Self {
8858 Self::DEFAULT.clone()
8859 }
8860}
8861impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8862 type Message = MavMessage;
8863 const ID: u32 = 6u32;
8864 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8865 const EXTRA_CRC: u8 = 104u8;
8866 const ENCODED_LEN: usize = 3usize;
8867 fn deser(
8868 _version: MavlinkVersion,
8869 __input: &[u8],
8870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8871 let avail_len = __input.len();
8872 let mut payload_buf = [0; Self::ENCODED_LEN];
8873 let mut buf = if avail_len < Self::ENCODED_LEN {
8874 payload_buf[0..avail_len].copy_from_slice(__input);
8875 Bytes::new(&payload_buf)
8876 } else {
8877 Bytes::new(__input)
8878 };
8879 let mut __struct = Self::default();
8880 __struct.gcs_system_id = buf.get_u8();
8881 __struct.control_request = buf.get_u8();
8882 __struct.ack = buf.get_u8();
8883 Ok(__struct)
8884 }
8885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8886 let mut __tmp = BytesMut::new(bytes);
8887 #[allow(clippy::absurd_extreme_comparisons)]
8888 #[allow(unused_comparisons)]
8889 if __tmp.remaining() < Self::ENCODED_LEN {
8890 panic!(
8891 "buffer is too small (need {} bytes, but got {})",
8892 Self::ENCODED_LEN,
8893 __tmp.remaining(),
8894 )
8895 }
8896 __tmp.put_u8(self.gcs_system_id);
8897 __tmp.put_u8(self.control_request);
8898 __tmp.put_u8(self.ack);
8899 if matches!(version, MavlinkVersion::V2) {
8900 let len = __tmp.len();
8901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8902 } else {
8903 __tmp.len()
8904 }
8905 }
8906}
8907#[doc = "id: 247"]
8908#[doc = "Information about a potential collision."]
8909#[derive(Debug, Clone, PartialEq)]
8910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8912pub struct COLLISION_DATA {
8913 #[doc = "Unique identifier, domain based on src field"]
8914 pub id: u32,
8915 #[doc = "Estimated time until collision occurs"]
8916 pub time_to_minimum_delta: f32,
8917 #[doc = "Closest vertical distance between vehicle and object"]
8918 pub altitude_minimum_delta: f32,
8919 #[doc = "Closest horizontal distance between vehicle and object"]
8920 pub horizontal_minimum_delta: f32,
8921 #[doc = "Collision data source"]
8922 pub src: MavCollisionSrc,
8923 #[doc = "Action that is being taken to avoid this collision"]
8924 pub action: MavCollisionAction,
8925 #[doc = "How concerned the aircraft is about this collision"]
8926 pub threat_level: MavCollisionThreatLevel,
8927}
8928impl COLLISION_DATA {
8929 pub const ENCODED_LEN: usize = 19usize;
8930 pub const DEFAULT: Self = Self {
8931 id: 0_u32,
8932 time_to_minimum_delta: 0.0_f32,
8933 altitude_minimum_delta: 0.0_f32,
8934 horizontal_minimum_delta: 0.0_f32,
8935 src: MavCollisionSrc::DEFAULT,
8936 action: MavCollisionAction::DEFAULT,
8937 threat_level: MavCollisionThreatLevel::DEFAULT,
8938 };
8939 #[cfg(feature = "arbitrary")]
8940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8941 use arbitrary::{Arbitrary, Unstructured};
8942 let mut buf = [0u8; 1024];
8943 rng.fill_bytes(&mut buf);
8944 let mut unstructured = Unstructured::new(&buf);
8945 Self::arbitrary(&mut unstructured).unwrap_or_default()
8946 }
8947}
8948impl Default for COLLISION_DATA {
8949 fn default() -> Self {
8950 Self::DEFAULT.clone()
8951 }
8952}
8953impl MessageData for COLLISION_DATA {
8954 type Message = MavMessage;
8955 const ID: u32 = 247u32;
8956 const NAME: &'static str = "COLLISION";
8957 const EXTRA_CRC: u8 = 81u8;
8958 const ENCODED_LEN: usize = 19usize;
8959 fn deser(
8960 _version: MavlinkVersion,
8961 __input: &[u8],
8962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8963 let avail_len = __input.len();
8964 let mut payload_buf = [0; Self::ENCODED_LEN];
8965 let mut buf = if avail_len < Self::ENCODED_LEN {
8966 payload_buf[0..avail_len].copy_from_slice(__input);
8967 Bytes::new(&payload_buf)
8968 } else {
8969 Bytes::new(__input)
8970 };
8971 let mut __struct = Self::default();
8972 __struct.id = buf.get_u32_le();
8973 __struct.time_to_minimum_delta = buf.get_f32_le();
8974 __struct.altitude_minimum_delta = buf.get_f32_le();
8975 __struct.horizontal_minimum_delta = buf.get_f32_le();
8976 let tmp = buf.get_u8();
8977 __struct.src =
8978 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8979 enum_type: "MavCollisionSrc",
8980 value: tmp as u32,
8981 })?;
8982 let tmp = buf.get_u8();
8983 __struct.action =
8984 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8985 enum_type: "MavCollisionAction",
8986 value: tmp as u32,
8987 })?;
8988 let tmp = buf.get_u8();
8989 __struct.threat_level =
8990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8991 enum_type: "MavCollisionThreatLevel",
8992 value: tmp as u32,
8993 })?;
8994 Ok(__struct)
8995 }
8996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8997 let mut __tmp = BytesMut::new(bytes);
8998 #[allow(clippy::absurd_extreme_comparisons)]
8999 #[allow(unused_comparisons)]
9000 if __tmp.remaining() < Self::ENCODED_LEN {
9001 panic!(
9002 "buffer is too small (need {} bytes, but got {})",
9003 Self::ENCODED_LEN,
9004 __tmp.remaining(),
9005 )
9006 }
9007 __tmp.put_u32_le(self.id);
9008 __tmp.put_f32_le(self.time_to_minimum_delta);
9009 __tmp.put_f32_le(self.altitude_minimum_delta);
9010 __tmp.put_f32_le(self.horizontal_minimum_delta);
9011 __tmp.put_u8(self.src as u8);
9012 __tmp.put_u8(self.action as u8);
9013 __tmp.put_u8(self.threat_level as u8);
9014 if matches!(version, MavlinkVersion::V2) {
9015 let len = __tmp.len();
9016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9017 } else {
9018 __tmp.len()
9019 }
9020 }
9021}
9022#[doc = "id: 77"]
9023#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9024#[derive(Debug, Clone, PartialEq)]
9025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9027pub struct COMMAND_ACK_DATA {
9028 #[doc = "Command ID (of acknowledged command)."]
9029 pub command: MavCmd,
9030 #[doc = "Result of command."]
9031 pub result: MavResult,
9032 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9034 pub progress: u8,
9035 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9036 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9037 pub result_param2: i32,
9038 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9039 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9040 pub target_system: u8,
9041 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9042 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9043 pub target_component: u8,
9044}
9045impl COMMAND_ACK_DATA {
9046 pub const ENCODED_LEN: usize = 10usize;
9047 pub const DEFAULT: Self = Self {
9048 command: MavCmd::DEFAULT,
9049 result: MavResult::DEFAULT,
9050 progress: 0_u8,
9051 result_param2: 0_i32,
9052 target_system: 0_u8,
9053 target_component: 0_u8,
9054 };
9055 #[cfg(feature = "arbitrary")]
9056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9057 use arbitrary::{Arbitrary, Unstructured};
9058 let mut buf = [0u8; 1024];
9059 rng.fill_bytes(&mut buf);
9060 let mut unstructured = Unstructured::new(&buf);
9061 Self::arbitrary(&mut unstructured).unwrap_or_default()
9062 }
9063}
9064impl Default for COMMAND_ACK_DATA {
9065 fn default() -> Self {
9066 Self::DEFAULT.clone()
9067 }
9068}
9069impl MessageData for COMMAND_ACK_DATA {
9070 type Message = MavMessage;
9071 const ID: u32 = 77u32;
9072 const NAME: &'static str = "COMMAND_ACK";
9073 const EXTRA_CRC: u8 = 143u8;
9074 const ENCODED_LEN: usize = 10usize;
9075 fn deser(
9076 _version: MavlinkVersion,
9077 __input: &[u8],
9078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9079 let avail_len = __input.len();
9080 let mut payload_buf = [0; Self::ENCODED_LEN];
9081 let mut buf = if avail_len < Self::ENCODED_LEN {
9082 payload_buf[0..avail_len].copy_from_slice(__input);
9083 Bytes::new(&payload_buf)
9084 } else {
9085 Bytes::new(__input)
9086 };
9087 let mut __struct = Self::default();
9088 let tmp = buf.get_u16_le();
9089 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9090 ::mavlink_core::error::ParserError::InvalidEnum {
9091 enum_type: "MavCmd",
9092 value: tmp as u32,
9093 },
9094 )?;
9095 let tmp = buf.get_u8();
9096 __struct.result =
9097 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9098 enum_type: "MavResult",
9099 value: tmp as u32,
9100 })?;
9101 __struct.progress = buf.get_u8();
9102 __struct.result_param2 = buf.get_i32_le();
9103 __struct.target_system = buf.get_u8();
9104 __struct.target_component = buf.get_u8();
9105 Ok(__struct)
9106 }
9107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9108 let mut __tmp = BytesMut::new(bytes);
9109 #[allow(clippy::absurd_extreme_comparisons)]
9110 #[allow(unused_comparisons)]
9111 if __tmp.remaining() < Self::ENCODED_LEN {
9112 panic!(
9113 "buffer is too small (need {} bytes, but got {})",
9114 Self::ENCODED_LEN,
9115 __tmp.remaining(),
9116 )
9117 }
9118 __tmp.put_u16_le(self.command as u16);
9119 __tmp.put_u8(self.result as u8);
9120 __tmp.put_u8(self.progress);
9121 __tmp.put_i32_le(self.result_param2);
9122 __tmp.put_u8(self.target_system);
9123 __tmp.put_u8(self.target_component);
9124 if matches!(version, MavlinkVersion::V2) {
9125 let len = __tmp.len();
9126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9127 } else {
9128 __tmp.len()
9129 }
9130 }
9131}
9132#[doc = "id: 80"]
9133#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9134#[derive(Debug, Clone, PartialEq)]
9135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9137pub struct COMMAND_CANCEL_DATA {
9138 #[doc = "Command ID (of command to cancel)."]
9139 pub command: MavCmd,
9140 #[doc = "System executing long running command. Should not be broadcast (0)."]
9141 pub target_system: u8,
9142 #[doc = "Component executing long running command."]
9143 pub target_component: u8,
9144}
9145impl COMMAND_CANCEL_DATA {
9146 pub const ENCODED_LEN: usize = 4usize;
9147 pub const DEFAULT: Self = Self {
9148 command: MavCmd::DEFAULT,
9149 target_system: 0_u8,
9150 target_component: 0_u8,
9151 };
9152 #[cfg(feature = "arbitrary")]
9153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9154 use arbitrary::{Arbitrary, Unstructured};
9155 let mut buf = [0u8; 1024];
9156 rng.fill_bytes(&mut buf);
9157 let mut unstructured = Unstructured::new(&buf);
9158 Self::arbitrary(&mut unstructured).unwrap_or_default()
9159 }
9160}
9161impl Default for COMMAND_CANCEL_DATA {
9162 fn default() -> Self {
9163 Self::DEFAULT.clone()
9164 }
9165}
9166impl MessageData for COMMAND_CANCEL_DATA {
9167 type Message = MavMessage;
9168 const ID: u32 = 80u32;
9169 const NAME: &'static str = "COMMAND_CANCEL";
9170 const EXTRA_CRC: u8 = 14u8;
9171 const ENCODED_LEN: usize = 4usize;
9172 fn deser(
9173 _version: MavlinkVersion,
9174 __input: &[u8],
9175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9176 let avail_len = __input.len();
9177 let mut payload_buf = [0; Self::ENCODED_LEN];
9178 let mut buf = if avail_len < Self::ENCODED_LEN {
9179 payload_buf[0..avail_len].copy_from_slice(__input);
9180 Bytes::new(&payload_buf)
9181 } else {
9182 Bytes::new(__input)
9183 };
9184 let mut __struct = Self::default();
9185 let tmp = buf.get_u16_le();
9186 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9187 ::mavlink_core::error::ParserError::InvalidEnum {
9188 enum_type: "MavCmd",
9189 value: tmp as u32,
9190 },
9191 )?;
9192 __struct.target_system = buf.get_u8();
9193 __struct.target_component = buf.get_u8();
9194 Ok(__struct)
9195 }
9196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9197 let mut __tmp = BytesMut::new(bytes);
9198 #[allow(clippy::absurd_extreme_comparisons)]
9199 #[allow(unused_comparisons)]
9200 if __tmp.remaining() < Self::ENCODED_LEN {
9201 panic!(
9202 "buffer is too small (need {} bytes, but got {})",
9203 Self::ENCODED_LEN,
9204 __tmp.remaining(),
9205 )
9206 }
9207 __tmp.put_u16_le(self.command as u16);
9208 __tmp.put_u8(self.target_system);
9209 __tmp.put_u8(self.target_component);
9210 if matches!(version, MavlinkVersion::V2) {
9211 let len = __tmp.len();
9212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9213 } else {
9214 __tmp.len()
9215 }
9216 }
9217}
9218#[doc = "id: 75"]
9219#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9220#[derive(Debug, Clone, PartialEq)]
9221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9223pub struct COMMAND_INT_DATA {
9224 #[doc = "PARAM1, see MAV_CMD enum"]
9225 pub param1: f32,
9226 #[doc = "PARAM2, see MAV_CMD enum"]
9227 pub param2: f32,
9228 #[doc = "PARAM3, see MAV_CMD enum"]
9229 pub param3: f32,
9230 #[doc = "PARAM4, see MAV_CMD enum"]
9231 pub param4: f32,
9232 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9233 pub x: i32,
9234 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9235 pub y: i32,
9236 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9237 pub z: f32,
9238 #[doc = "The scheduled action for the mission item."]
9239 pub command: MavCmd,
9240 #[doc = "System ID"]
9241 pub target_system: u8,
9242 #[doc = "Component ID"]
9243 pub target_component: u8,
9244 #[doc = "The coordinate system of the COMMAND."]
9245 pub frame: MavFrame,
9246 #[doc = "Not used."]
9247 pub current: u8,
9248 #[doc = "Not used (set 0)."]
9249 pub autocontinue: u8,
9250}
9251impl COMMAND_INT_DATA {
9252 pub const ENCODED_LEN: usize = 35usize;
9253 pub const DEFAULT: Self = Self {
9254 param1: 0.0_f32,
9255 param2: 0.0_f32,
9256 param3: 0.0_f32,
9257 param4: 0.0_f32,
9258 x: 0_i32,
9259 y: 0_i32,
9260 z: 0.0_f32,
9261 command: MavCmd::DEFAULT,
9262 target_system: 0_u8,
9263 target_component: 0_u8,
9264 frame: MavFrame::DEFAULT,
9265 current: 0_u8,
9266 autocontinue: 0_u8,
9267 };
9268 #[cfg(feature = "arbitrary")]
9269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9270 use arbitrary::{Arbitrary, Unstructured};
9271 let mut buf = [0u8; 1024];
9272 rng.fill_bytes(&mut buf);
9273 let mut unstructured = Unstructured::new(&buf);
9274 Self::arbitrary(&mut unstructured).unwrap_or_default()
9275 }
9276}
9277impl Default for COMMAND_INT_DATA {
9278 fn default() -> Self {
9279 Self::DEFAULT.clone()
9280 }
9281}
9282impl MessageData for COMMAND_INT_DATA {
9283 type Message = MavMessage;
9284 const ID: u32 = 75u32;
9285 const NAME: &'static str = "COMMAND_INT";
9286 const EXTRA_CRC: u8 = 158u8;
9287 const ENCODED_LEN: usize = 35usize;
9288 fn deser(
9289 _version: MavlinkVersion,
9290 __input: &[u8],
9291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9292 let avail_len = __input.len();
9293 let mut payload_buf = [0; Self::ENCODED_LEN];
9294 let mut buf = if avail_len < Self::ENCODED_LEN {
9295 payload_buf[0..avail_len].copy_from_slice(__input);
9296 Bytes::new(&payload_buf)
9297 } else {
9298 Bytes::new(__input)
9299 };
9300 let mut __struct = Self::default();
9301 __struct.param1 = buf.get_f32_le();
9302 __struct.param2 = buf.get_f32_le();
9303 __struct.param3 = buf.get_f32_le();
9304 __struct.param4 = buf.get_f32_le();
9305 __struct.x = buf.get_i32_le();
9306 __struct.y = buf.get_i32_le();
9307 __struct.z = buf.get_f32_le();
9308 let tmp = buf.get_u16_le();
9309 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9310 ::mavlink_core::error::ParserError::InvalidEnum {
9311 enum_type: "MavCmd",
9312 value: tmp as u32,
9313 },
9314 )?;
9315 __struct.target_system = buf.get_u8();
9316 __struct.target_component = buf.get_u8();
9317 let tmp = buf.get_u8();
9318 __struct.frame =
9319 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9320 enum_type: "MavFrame",
9321 value: tmp as u32,
9322 })?;
9323 __struct.current = buf.get_u8();
9324 __struct.autocontinue = buf.get_u8();
9325 Ok(__struct)
9326 }
9327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9328 let mut __tmp = BytesMut::new(bytes);
9329 #[allow(clippy::absurd_extreme_comparisons)]
9330 #[allow(unused_comparisons)]
9331 if __tmp.remaining() < Self::ENCODED_LEN {
9332 panic!(
9333 "buffer is too small (need {} bytes, but got {})",
9334 Self::ENCODED_LEN,
9335 __tmp.remaining(),
9336 )
9337 }
9338 __tmp.put_f32_le(self.param1);
9339 __tmp.put_f32_le(self.param2);
9340 __tmp.put_f32_le(self.param3);
9341 __tmp.put_f32_le(self.param4);
9342 __tmp.put_i32_le(self.x);
9343 __tmp.put_i32_le(self.y);
9344 __tmp.put_f32_le(self.z);
9345 __tmp.put_u16_le(self.command as u16);
9346 __tmp.put_u8(self.target_system);
9347 __tmp.put_u8(self.target_component);
9348 __tmp.put_u8(self.frame as u8);
9349 __tmp.put_u8(self.current);
9350 __tmp.put_u8(self.autocontinue);
9351 if matches!(version, MavlinkVersion::V2) {
9352 let len = __tmp.len();
9353 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9354 } else {
9355 __tmp.len()
9356 }
9357 }
9358}
9359#[doc = "id: 76"]
9360#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9361#[derive(Debug, Clone, PartialEq)]
9362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9364pub struct COMMAND_LONG_DATA {
9365 #[doc = "Parameter 1 (for the specific command)."]
9366 pub param1: f32,
9367 #[doc = "Parameter 2 (for the specific command)."]
9368 pub param2: f32,
9369 #[doc = "Parameter 3 (for the specific command)."]
9370 pub param3: f32,
9371 #[doc = "Parameter 4 (for the specific command)."]
9372 pub param4: f32,
9373 #[doc = "Parameter 5 (for the specific command)."]
9374 pub param5: f32,
9375 #[doc = "Parameter 6 (for the specific command)."]
9376 pub param6: f32,
9377 #[doc = "Parameter 7 (for the specific command)."]
9378 pub param7: f32,
9379 #[doc = "Command ID (of command to send)."]
9380 pub command: MavCmd,
9381 #[doc = "System which should execute the command"]
9382 pub target_system: u8,
9383 #[doc = "Component which should execute the command, 0 for all components"]
9384 pub target_component: u8,
9385 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9386 pub confirmation: u8,
9387}
9388impl COMMAND_LONG_DATA {
9389 pub const ENCODED_LEN: usize = 33usize;
9390 pub const DEFAULT: Self = Self {
9391 param1: 0.0_f32,
9392 param2: 0.0_f32,
9393 param3: 0.0_f32,
9394 param4: 0.0_f32,
9395 param5: 0.0_f32,
9396 param6: 0.0_f32,
9397 param7: 0.0_f32,
9398 command: MavCmd::DEFAULT,
9399 target_system: 0_u8,
9400 target_component: 0_u8,
9401 confirmation: 0_u8,
9402 };
9403 #[cfg(feature = "arbitrary")]
9404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9405 use arbitrary::{Arbitrary, Unstructured};
9406 let mut buf = [0u8; 1024];
9407 rng.fill_bytes(&mut buf);
9408 let mut unstructured = Unstructured::new(&buf);
9409 Self::arbitrary(&mut unstructured).unwrap_or_default()
9410 }
9411}
9412impl Default for COMMAND_LONG_DATA {
9413 fn default() -> Self {
9414 Self::DEFAULT.clone()
9415 }
9416}
9417impl MessageData for COMMAND_LONG_DATA {
9418 type Message = MavMessage;
9419 const ID: u32 = 76u32;
9420 const NAME: &'static str = "COMMAND_LONG";
9421 const EXTRA_CRC: u8 = 152u8;
9422 const ENCODED_LEN: usize = 33usize;
9423 fn deser(
9424 _version: MavlinkVersion,
9425 __input: &[u8],
9426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9427 let avail_len = __input.len();
9428 let mut payload_buf = [0; Self::ENCODED_LEN];
9429 let mut buf = if avail_len < Self::ENCODED_LEN {
9430 payload_buf[0..avail_len].copy_from_slice(__input);
9431 Bytes::new(&payload_buf)
9432 } else {
9433 Bytes::new(__input)
9434 };
9435 let mut __struct = Self::default();
9436 __struct.param1 = buf.get_f32_le();
9437 __struct.param2 = buf.get_f32_le();
9438 __struct.param3 = buf.get_f32_le();
9439 __struct.param4 = buf.get_f32_le();
9440 __struct.param5 = buf.get_f32_le();
9441 __struct.param6 = buf.get_f32_le();
9442 __struct.param7 = buf.get_f32_le();
9443 let tmp = buf.get_u16_le();
9444 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9445 ::mavlink_core::error::ParserError::InvalidEnum {
9446 enum_type: "MavCmd",
9447 value: tmp as u32,
9448 },
9449 )?;
9450 __struct.target_system = buf.get_u8();
9451 __struct.target_component = buf.get_u8();
9452 __struct.confirmation = buf.get_u8();
9453 Ok(__struct)
9454 }
9455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9456 let mut __tmp = BytesMut::new(bytes);
9457 #[allow(clippy::absurd_extreme_comparisons)]
9458 #[allow(unused_comparisons)]
9459 if __tmp.remaining() < Self::ENCODED_LEN {
9460 panic!(
9461 "buffer is too small (need {} bytes, but got {})",
9462 Self::ENCODED_LEN,
9463 __tmp.remaining(),
9464 )
9465 }
9466 __tmp.put_f32_le(self.param1);
9467 __tmp.put_f32_le(self.param2);
9468 __tmp.put_f32_le(self.param3);
9469 __tmp.put_f32_le(self.param4);
9470 __tmp.put_f32_le(self.param5);
9471 __tmp.put_f32_le(self.param6);
9472 __tmp.put_f32_le(self.param7);
9473 __tmp.put_u16_le(self.command as u16);
9474 __tmp.put_u8(self.target_system);
9475 __tmp.put_u8(self.target_component);
9476 __tmp.put_u8(self.confirmation);
9477 if matches!(version, MavlinkVersion::V2) {
9478 let len = __tmp.len();
9479 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9480 } else {
9481 __tmp.len()
9482 }
9483 }
9484}
9485#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9486#[doc = "id: 395"]
9487#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9488#[derive(Debug, Clone, PartialEq)]
9489#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9490#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9491pub struct COMPONENT_INFORMATION_DATA {
9492 #[doc = "Timestamp (time since system boot)."]
9493 pub time_boot_ms: u32,
9494 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9495 pub general_metadata_file_crc: u32,
9496 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9497 pub peripherals_metadata_file_crc: u32,
9498 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9499 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9500 pub general_metadata_uri: [u8; 100],
9501 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9502 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9503 pub peripherals_metadata_uri: [u8; 100],
9504}
9505impl COMPONENT_INFORMATION_DATA {
9506 pub const ENCODED_LEN: usize = 212usize;
9507 pub const DEFAULT: Self = Self {
9508 time_boot_ms: 0_u32,
9509 general_metadata_file_crc: 0_u32,
9510 peripherals_metadata_file_crc: 0_u32,
9511 general_metadata_uri: [0_u8; 100usize],
9512 peripherals_metadata_uri: [0_u8; 100usize],
9513 };
9514 #[cfg(feature = "arbitrary")]
9515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9516 use arbitrary::{Arbitrary, Unstructured};
9517 let mut buf = [0u8; 1024];
9518 rng.fill_bytes(&mut buf);
9519 let mut unstructured = Unstructured::new(&buf);
9520 Self::arbitrary(&mut unstructured).unwrap_or_default()
9521 }
9522}
9523impl Default for COMPONENT_INFORMATION_DATA {
9524 fn default() -> Self {
9525 Self::DEFAULT.clone()
9526 }
9527}
9528impl MessageData for COMPONENT_INFORMATION_DATA {
9529 type Message = MavMessage;
9530 const ID: u32 = 395u32;
9531 const NAME: &'static str = "COMPONENT_INFORMATION";
9532 const EXTRA_CRC: u8 = 0u8;
9533 const ENCODED_LEN: usize = 212usize;
9534 fn deser(
9535 _version: MavlinkVersion,
9536 __input: &[u8],
9537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9538 let avail_len = __input.len();
9539 let mut payload_buf = [0; Self::ENCODED_LEN];
9540 let mut buf = if avail_len < Self::ENCODED_LEN {
9541 payload_buf[0..avail_len].copy_from_slice(__input);
9542 Bytes::new(&payload_buf)
9543 } else {
9544 Bytes::new(__input)
9545 };
9546 let mut __struct = Self::default();
9547 __struct.time_boot_ms = buf.get_u32_le();
9548 __struct.general_metadata_file_crc = buf.get_u32_le();
9549 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9550 for v in &mut __struct.general_metadata_uri {
9551 let val = buf.get_u8();
9552 *v = val;
9553 }
9554 for v in &mut __struct.peripherals_metadata_uri {
9555 let val = buf.get_u8();
9556 *v = val;
9557 }
9558 Ok(__struct)
9559 }
9560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9561 let mut __tmp = BytesMut::new(bytes);
9562 #[allow(clippy::absurd_extreme_comparisons)]
9563 #[allow(unused_comparisons)]
9564 if __tmp.remaining() < Self::ENCODED_LEN {
9565 panic!(
9566 "buffer is too small (need {} bytes, but got {})",
9567 Self::ENCODED_LEN,
9568 __tmp.remaining(),
9569 )
9570 }
9571 __tmp.put_u32_le(self.time_boot_ms);
9572 __tmp.put_u32_le(self.general_metadata_file_crc);
9573 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9574 for val in &self.general_metadata_uri {
9575 __tmp.put_u8(*val);
9576 }
9577 for val in &self.peripherals_metadata_uri {
9578 __tmp.put_u8(*val);
9579 }
9580 if matches!(version, MavlinkVersion::V2) {
9581 let len = __tmp.len();
9582 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9583 } else {
9584 __tmp.len()
9585 }
9586 }
9587}
9588#[doc = "id: 396"]
9589#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9590#[derive(Debug, Clone, PartialEq)]
9591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9593pub struct COMPONENT_INFORMATION_BASIC_DATA {
9594 #[doc = "Component capability flags"]
9595 pub capabilities: MavProtocolCapability,
9596 #[doc = "Timestamp (time since system boot)."]
9597 pub time_boot_ms: u32,
9598 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9599 pub time_manufacture_s: u32,
9600 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9602 pub vendor_name: [u8; 32],
9603 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9605 pub model_name: [u8; 32],
9606 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9607 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9608 pub software_version: [u8; 24],
9609 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9610 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9611 pub hardware_version: [u8; 24],
9612 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9613 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9614 pub serial_number: [u8; 32],
9615}
9616impl COMPONENT_INFORMATION_BASIC_DATA {
9617 pub const ENCODED_LEN: usize = 160usize;
9618 pub const DEFAULT: Self = Self {
9619 capabilities: MavProtocolCapability::DEFAULT,
9620 time_boot_ms: 0_u32,
9621 time_manufacture_s: 0_u32,
9622 vendor_name: [0_u8; 32usize],
9623 model_name: [0_u8; 32usize],
9624 software_version: [0_u8; 24usize],
9625 hardware_version: [0_u8; 24usize],
9626 serial_number: [0_u8; 32usize],
9627 };
9628 #[cfg(feature = "arbitrary")]
9629 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9630 use arbitrary::{Arbitrary, Unstructured};
9631 let mut buf = [0u8; 1024];
9632 rng.fill_bytes(&mut buf);
9633 let mut unstructured = Unstructured::new(&buf);
9634 Self::arbitrary(&mut unstructured).unwrap_or_default()
9635 }
9636}
9637impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9638 fn default() -> Self {
9639 Self::DEFAULT.clone()
9640 }
9641}
9642impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9643 type Message = MavMessage;
9644 const ID: u32 = 396u32;
9645 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9646 const EXTRA_CRC: u8 = 50u8;
9647 const ENCODED_LEN: usize = 160usize;
9648 fn deser(
9649 _version: MavlinkVersion,
9650 __input: &[u8],
9651 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9652 let avail_len = __input.len();
9653 let mut payload_buf = [0; Self::ENCODED_LEN];
9654 let mut buf = if avail_len < Self::ENCODED_LEN {
9655 payload_buf[0..avail_len].copy_from_slice(__input);
9656 Bytes::new(&payload_buf)
9657 } else {
9658 Bytes::new(__input)
9659 };
9660 let mut __struct = Self::default();
9661 let tmp = buf.get_u64_le();
9662 __struct.capabilities = MavProtocolCapability::from_bits(
9663 tmp & MavProtocolCapability::all().bits(),
9664 )
9665 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9666 flag_type: "MavProtocolCapability",
9667 value: tmp as u32,
9668 })?;
9669 __struct.time_boot_ms = buf.get_u32_le();
9670 __struct.time_manufacture_s = buf.get_u32_le();
9671 for v in &mut __struct.vendor_name {
9672 let val = buf.get_u8();
9673 *v = val;
9674 }
9675 for v in &mut __struct.model_name {
9676 let val = buf.get_u8();
9677 *v = val;
9678 }
9679 for v in &mut __struct.software_version {
9680 let val = buf.get_u8();
9681 *v = val;
9682 }
9683 for v in &mut __struct.hardware_version {
9684 let val = buf.get_u8();
9685 *v = val;
9686 }
9687 for v in &mut __struct.serial_number {
9688 let val = buf.get_u8();
9689 *v = val;
9690 }
9691 Ok(__struct)
9692 }
9693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9694 let mut __tmp = BytesMut::new(bytes);
9695 #[allow(clippy::absurd_extreme_comparisons)]
9696 #[allow(unused_comparisons)]
9697 if __tmp.remaining() < Self::ENCODED_LEN {
9698 panic!(
9699 "buffer is too small (need {} bytes, but got {})",
9700 Self::ENCODED_LEN,
9701 __tmp.remaining(),
9702 )
9703 }
9704 __tmp.put_u64_le(self.capabilities.bits());
9705 __tmp.put_u32_le(self.time_boot_ms);
9706 __tmp.put_u32_le(self.time_manufacture_s);
9707 for val in &self.vendor_name {
9708 __tmp.put_u8(*val);
9709 }
9710 for val in &self.model_name {
9711 __tmp.put_u8(*val);
9712 }
9713 for val in &self.software_version {
9714 __tmp.put_u8(*val);
9715 }
9716 for val in &self.hardware_version {
9717 __tmp.put_u8(*val);
9718 }
9719 for val in &self.serial_number {
9720 __tmp.put_u8(*val);
9721 }
9722 if matches!(version, MavlinkVersion::V2) {
9723 let len = __tmp.len();
9724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9725 } else {
9726 __tmp.len()
9727 }
9728 }
9729}
9730#[doc = "id: 397"]
9731#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9732#[derive(Debug, Clone, PartialEq)]
9733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9735pub struct COMPONENT_METADATA_DATA {
9736 #[doc = "Timestamp (time since system boot)."]
9737 pub time_boot_ms: u32,
9738 #[doc = "CRC32 of the general metadata file."]
9739 pub file_crc: u32,
9740 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9741 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9742 pub uri: [u8; 100],
9743}
9744impl COMPONENT_METADATA_DATA {
9745 pub const ENCODED_LEN: usize = 108usize;
9746 pub const DEFAULT: Self = Self {
9747 time_boot_ms: 0_u32,
9748 file_crc: 0_u32,
9749 uri: [0_u8; 100usize],
9750 };
9751 #[cfg(feature = "arbitrary")]
9752 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9753 use arbitrary::{Arbitrary, Unstructured};
9754 let mut buf = [0u8; 1024];
9755 rng.fill_bytes(&mut buf);
9756 let mut unstructured = Unstructured::new(&buf);
9757 Self::arbitrary(&mut unstructured).unwrap_or_default()
9758 }
9759}
9760impl Default for COMPONENT_METADATA_DATA {
9761 fn default() -> Self {
9762 Self::DEFAULT.clone()
9763 }
9764}
9765impl MessageData for COMPONENT_METADATA_DATA {
9766 type Message = MavMessage;
9767 const ID: u32 = 397u32;
9768 const NAME: &'static str = "COMPONENT_METADATA";
9769 const EXTRA_CRC: u8 = 182u8;
9770 const ENCODED_LEN: usize = 108usize;
9771 fn deser(
9772 _version: MavlinkVersion,
9773 __input: &[u8],
9774 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9775 let avail_len = __input.len();
9776 let mut payload_buf = [0; Self::ENCODED_LEN];
9777 let mut buf = if avail_len < Self::ENCODED_LEN {
9778 payload_buf[0..avail_len].copy_from_slice(__input);
9779 Bytes::new(&payload_buf)
9780 } else {
9781 Bytes::new(__input)
9782 };
9783 let mut __struct = Self::default();
9784 __struct.time_boot_ms = buf.get_u32_le();
9785 __struct.file_crc = buf.get_u32_le();
9786 for v in &mut __struct.uri {
9787 let val = buf.get_u8();
9788 *v = val;
9789 }
9790 Ok(__struct)
9791 }
9792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9793 let mut __tmp = BytesMut::new(bytes);
9794 #[allow(clippy::absurd_extreme_comparisons)]
9795 #[allow(unused_comparisons)]
9796 if __tmp.remaining() < Self::ENCODED_LEN {
9797 panic!(
9798 "buffer is too small (need {} bytes, but got {})",
9799 Self::ENCODED_LEN,
9800 __tmp.remaining(),
9801 )
9802 }
9803 __tmp.put_u32_le(self.time_boot_ms);
9804 __tmp.put_u32_le(self.file_crc);
9805 for val in &self.uri {
9806 __tmp.put_u8(*val);
9807 }
9808 if matches!(version, MavlinkVersion::V2) {
9809 let len = __tmp.len();
9810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9811 } else {
9812 __tmp.len()
9813 }
9814 }
9815}
9816#[doc = "id: 146"]
9817#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9818#[derive(Debug, Clone, PartialEq)]
9819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9821pub struct CONTROL_SYSTEM_STATE_DATA {
9822 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9823 pub time_usec: u64,
9824 #[doc = "X acceleration in body frame"]
9825 pub x_acc: f32,
9826 #[doc = "Y acceleration in body frame"]
9827 pub y_acc: f32,
9828 #[doc = "Z acceleration in body frame"]
9829 pub z_acc: f32,
9830 #[doc = "X velocity in body frame"]
9831 pub x_vel: f32,
9832 #[doc = "Y velocity in body frame"]
9833 pub y_vel: f32,
9834 #[doc = "Z velocity in body frame"]
9835 pub z_vel: f32,
9836 #[doc = "X position in local frame"]
9837 pub x_pos: f32,
9838 #[doc = "Y position in local frame"]
9839 pub y_pos: f32,
9840 #[doc = "Z position in local frame"]
9841 pub z_pos: f32,
9842 #[doc = "Airspeed, set to -1 if unknown"]
9843 pub airspeed: f32,
9844 #[doc = "Variance of body velocity estimate"]
9845 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9846 pub vel_variance: [f32; 3],
9847 #[doc = "Variance in local position"]
9848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9849 pub pos_variance: [f32; 3],
9850 #[doc = "The attitude, represented as Quaternion"]
9851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9852 pub q: [f32; 4],
9853 #[doc = "Angular rate in roll axis"]
9854 pub roll_rate: f32,
9855 #[doc = "Angular rate in pitch axis"]
9856 pub pitch_rate: f32,
9857 #[doc = "Angular rate in yaw axis"]
9858 pub yaw_rate: f32,
9859}
9860impl CONTROL_SYSTEM_STATE_DATA {
9861 pub const ENCODED_LEN: usize = 100usize;
9862 pub const DEFAULT: Self = Self {
9863 time_usec: 0_u64,
9864 x_acc: 0.0_f32,
9865 y_acc: 0.0_f32,
9866 z_acc: 0.0_f32,
9867 x_vel: 0.0_f32,
9868 y_vel: 0.0_f32,
9869 z_vel: 0.0_f32,
9870 x_pos: 0.0_f32,
9871 y_pos: 0.0_f32,
9872 z_pos: 0.0_f32,
9873 airspeed: 0.0_f32,
9874 vel_variance: [0.0_f32; 3usize],
9875 pos_variance: [0.0_f32; 3usize],
9876 q: [0.0_f32; 4usize],
9877 roll_rate: 0.0_f32,
9878 pitch_rate: 0.0_f32,
9879 yaw_rate: 0.0_f32,
9880 };
9881 #[cfg(feature = "arbitrary")]
9882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9883 use arbitrary::{Arbitrary, Unstructured};
9884 let mut buf = [0u8; 1024];
9885 rng.fill_bytes(&mut buf);
9886 let mut unstructured = Unstructured::new(&buf);
9887 Self::arbitrary(&mut unstructured).unwrap_or_default()
9888 }
9889}
9890impl Default for CONTROL_SYSTEM_STATE_DATA {
9891 fn default() -> Self {
9892 Self::DEFAULT.clone()
9893 }
9894}
9895impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9896 type Message = MavMessage;
9897 const ID: u32 = 146u32;
9898 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9899 const EXTRA_CRC: u8 = 103u8;
9900 const ENCODED_LEN: usize = 100usize;
9901 fn deser(
9902 _version: MavlinkVersion,
9903 __input: &[u8],
9904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9905 let avail_len = __input.len();
9906 let mut payload_buf = [0; Self::ENCODED_LEN];
9907 let mut buf = if avail_len < Self::ENCODED_LEN {
9908 payload_buf[0..avail_len].copy_from_slice(__input);
9909 Bytes::new(&payload_buf)
9910 } else {
9911 Bytes::new(__input)
9912 };
9913 let mut __struct = Self::default();
9914 __struct.time_usec = buf.get_u64_le();
9915 __struct.x_acc = buf.get_f32_le();
9916 __struct.y_acc = buf.get_f32_le();
9917 __struct.z_acc = buf.get_f32_le();
9918 __struct.x_vel = buf.get_f32_le();
9919 __struct.y_vel = buf.get_f32_le();
9920 __struct.z_vel = buf.get_f32_le();
9921 __struct.x_pos = buf.get_f32_le();
9922 __struct.y_pos = buf.get_f32_le();
9923 __struct.z_pos = buf.get_f32_le();
9924 __struct.airspeed = buf.get_f32_le();
9925 for v in &mut __struct.vel_variance {
9926 let val = buf.get_f32_le();
9927 *v = val;
9928 }
9929 for v in &mut __struct.pos_variance {
9930 let val = buf.get_f32_le();
9931 *v = val;
9932 }
9933 for v in &mut __struct.q {
9934 let val = buf.get_f32_le();
9935 *v = val;
9936 }
9937 __struct.roll_rate = buf.get_f32_le();
9938 __struct.pitch_rate = buf.get_f32_le();
9939 __struct.yaw_rate = buf.get_f32_le();
9940 Ok(__struct)
9941 }
9942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9943 let mut __tmp = BytesMut::new(bytes);
9944 #[allow(clippy::absurd_extreme_comparisons)]
9945 #[allow(unused_comparisons)]
9946 if __tmp.remaining() < Self::ENCODED_LEN {
9947 panic!(
9948 "buffer is too small (need {} bytes, but got {})",
9949 Self::ENCODED_LEN,
9950 __tmp.remaining(),
9951 )
9952 }
9953 __tmp.put_u64_le(self.time_usec);
9954 __tmp.put_f32_le(self.x_acc);
9955 __tmp.put_f32_le(self.y_acc);
9956 __tmp.put_f32_le(self.z_acc);
9957 __tmp.put_f32_le(self.x_vel);
9958 __tmp.put_f32_le(self.y_vel);
9959 __tmp.put_f32_le(self.z_vel);
9960 __tmp.put_f32_le(self.x_pos);
9961 __tmp.put_f32_le(self.y_pos);
9962 __tmp.put_f32_le(self.z_pos);
9963 __tmp.put_f32_le(self.airspeed);
9964 for val in &self.vel_variance {
9965 __tmp.put_f32_le(*val);
9966 }
9967 for val in &self.pos_variance {
9968 __tmp.put_f32_le(*val);
9969 }
9970 for val in &self.q {
9971 __tmp.put_f32_le(*val);
9972 }
9973 __tmp.put_f32_le(self.roll_rate);
9974 __tmp.put_f32_le(self.pitch_rate);
9975 __tmp.put_f32_le(self.yaw_rate);
9976 if matches!(version, MavlinkVersion::V2) {
9977 let len = __tmp.len();
9978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9979 } else {
9980 __tmp.len()
9981 }
9982 }
9983}
9984#[doc = "id: 411"]
9985#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9986#[derive(Debug, Clone, PartialEq)]
9987#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9989pub struct CURRENT_EVENT_SEQUENCE_DATA {
9990 #[doc = "Sequence number."]
9991 pub sequence: u16,
9992 #[doc = "Flag bitset."]
9993 pub flags: MavEventCurrentSequenceFlags,
9994}
9995impl CURRENT_EVENT_SEQUENCE_DATA {
9996 pub const ENCODED_LEN: usize = 3usize;
9997 pub const DEFAULT: Self = Self {
9998 sequence: 0_u16,
9999 flags: MavEventCurrentSequenceFlags::DEFAULT,
10000 };
10001 #[cfg(feature = "arbitrary")]
10002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10003 use arbitrary::{Arbitrary, Unstructured};
10004 let mut buf = [0u8; 1024];
10005 rng.fill_bytes(&mut buf);
10006 let mut unstructured = Unstructured::new(&buf);
10007 Self::arbitrary(&mut unstructured).unwrap_or_default()
10008 }
10009}
10010impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10011 fn default() -> Self {
10012 Self::DEFAULT.clone()
10013 }
10014}
10015impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10016 type Message = MavMessage;
10017 const ID: u32 = 411u32;
10018 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10019 const EXTRA_CRC: u8 = 106u8;
10020 const ENCODED_LEN: usize = 3usize;
10021 fn deser(
10022 _version: MavlinkVersion,
10023 __input: &[u8],
10024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10025 let avail_len = __input.len();
10026 let mut payload_buf = [0; Self::ENCODED_LEN];
10027 let mut buf = if avail_len < Self::ENCODED_LEN {
10028 payload_buf[0..avail_len].copy_from_slice(__input);
10029 Bytes::new(&payload_buf)
10030 } else {
10031 Bytes::new(__input)
10032 };
10033 let mut __struct = Self::default();
10034 __struct.sequence = buf.get_u16_le();
10035 let tmp = buf.get_u8();
10036 __struct.flags =
10037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10038 enum_type: "MavEventCurrentSequenceFlags",
10039 value: tmp as u32,
10040 })?;
10041 Ok(__struct)
10042 }
10043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10044 let mut __tmp = BytesMut::new(bytes);
10045 #[allow(clippy::absurd_extreme_comparisons)]
10046 #[allow(unused_comparisons)]
10047 if __tmp.remaining() < Self::ENCODED_LEN {
10048 panic!(
10049 "buffer is too small (need {} bytes, but got {})",
10050 Self::ENCODED_LEN,
10051 __tmp.remaining(),
10052 )
10053 }
10054 __tmp.put_u16_le(self.sequence);
10055 __tmp.put_u8(self.flags as u8);
10056 if matches!(version, MavlinkVersion::V2) {
10057 let len = __tmp.len();
10058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10059 } else {
10060 __tmp.len()
10061 }
10062 }
10063}
10064#[doc = "id: 436"]
10065#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10066#[derive(Debug, Clone, PartialEq)]
10067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10069pub struct CURRENT_MODE_DATA {
10070 #[doc = "A bitfield for use for autopilot-specific flags"]
10071 pub custom_mode: u32,
10072 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10073 pub intended_custom_mode: u32,
10074 #[doc = "Standard mode."]
10075 pub standard_mode: MavStandardMode,
10076}
10077impl CURRENT_MODE_DATA {
10078 pub const ENCODED_LEN: usize = 9usize;
10079 pub const DEFAULT: Self = Self {
10080 custom_mode: 0_u32,
10081 intended_custom_mode: 0_u32,
10082 standard_mode: MavStandardMode::DEFAULT,
10083 };
10084 #[cfg(feature = "arbitrary")]
10085 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10086 use arbitrary::{Arbitrary, Unstructured};
10087 let mut buf = [0u8; 1024];
10088 rng.fill_bytes(&mut buf);
10089 let mut unstructured = Unstructured::new(&buf);
10090 Self::arbitrary(&mut unstructured).unwrap_or_default()
10091 }
10092}
10093impl Default for CURRENT_MODE_DATA {
10094 fn default() -> Self {
10095 Self::DEFAULT.clone()
10096 }
10097}
10098impl MessageData for CURRENT_MODE_DATA {
10099 type Message = MavMessage;
10100 const ID: u32 = 436u32;
10101 const NAME: &'static str = "CURRENT_MODE";
10102 const EXTRA_CRC: u8 = 193u8;
10103 const ENCODED_LEN: usize = 9usize;
10104 fn deser(
10105 _version: MavlinkVersion,
10106 __input: &[u8],
10107 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10108 let avail_len = __input.len();
10109 let mut payload_buf = [0; Self::ENCODED_LEN];
10110 let mut buf = if avail_len < Self::ENCODED_LEN {
10111 payload_buf[0..avail_len].copy_from_slice(__input);
10112 Bytes::new(&payload_buf)
10113 } else {
10114 Bytes::new(__input)
10115 };
10116 let mut __struct = Self::default();
10117 __struct.custom_mode = buf.get_u32_le();
10118 __struct.intended_custom_mode = buf.get_u32_le();
10119 let tmp = buf.get_u8();
10120 __struct.standard_mode =
10121 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10122 enum_type: "MavStandardMode",
10123 value: tmp as u32,
10124 })?;
10125 Ok(__struct)
10126 }
10127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10128 let mut __tmp = BytesMut::new(bytes);
10129 #[allow(clippy::absurd_extreme_comparisons)]
10130 #[allow(unused_comparisons)]
10131 if __tmp.remaining() < Self::ENCODED_LEN {
10132 panic!(
10133 "buffer is too small (need {} bytes, but got {})",
10134 Self::ENCODED_LEN,
10135 __tmp.remaining(),
10136 )
10137 }
10138 __tmp.put_u32_le(self.custom_mode);
10139 __tmp.put_u32_le(self.intended_custom_mode);
10140 __tmp.put_u8(self.standard_mode as u8);
10141 if matches!(version, MavlinkVersion::V2) {
10142 let len = __tmp.len();
10143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10144 } else {
10145 __tmp.len()
10146 }
10147 }
10148}
10149#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10150#[doc = "id: 67"]
10151#[doc = "Data stream status information."]
10152#[derive(Debug, Clone, PartialEq)]
10153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10155pub struct DATA_STREAM_DATA {
10156 #[doc = "The message rate"]
10157 pub message_rate: u16,
10158 #[doc = "The ID of the requested data stream"]
10159 pub stream_id: u8,
10160 #[doc = "1 stream is enabled, 0 stream is stopped."]
10161 pub on_off: u8,
10162}
10163impl DATA_STREAM_DATA {
10164 pub const ENCODED_LEN: usize = 4usize;
10165 pub const DEFAULT: Self = Self {
10166 message_rate: 0_u16,
10167 stream_id: 0_u8,
10168 on_off: 0_u8,
10169 };
10170 #[cfg(feature = "arbitrary")]
10171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10172 use arbitrary::{Arbitrary, Unstructured};
10173 let mut buf = [0u8; 1024];
10174 rng.fill_bytes(&mut buf);
10175 let mut unstructured = Unstructured::new(&buf);
10176 Self::arbitrary(&mut unstructured).unwrap_or_default()
10177 }
10178}
10179impl Default for DATA_STREAM_DATA {
10180 fn default() -> Self {
10181 Self::DEFAULT.clone()
10182 }
10183}
10184impl MessageData for DATA_STREAM_DATA {
10185 type Message = MavMessage;
10186 const ID: u32 = 67u32;
10187 const NAME: &'static str = "DATA_STREAM";
10188 const EXTRA_CRC: u8 = 21u8;
10189 const ENCODED_LEN: usize = 4usize;
10190 fn deser(
10191 _version: MavlinkVersion,
10192 __input: &[u8],
10193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10194 let avail_len = __input.len();
10195 let mut payload_buf = [0; Self::ENCODED_LEN];
10196 let mut buf = if avail_len < Self::ENCODED_LEN {
10197 payload_buf[0..avail_len].copy_from_slice(__input);
10198 Bytes::new(&payload_buf)
10199 } else {
10200 Bytes::new(__input)
10201 };
10202 let mut __struct = Self::default();
10203 __struct.message_rate = buf.get_u16_le();
10204 __struct.stream_id = buf.get_u8();
10205 __struct.on_off = buf.get_u8();
10206 Ok(__struct)
10207 }
10208 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10209 let mut __tmp = BytesMut::new(bytes);
10210 #[allow(clippy::absurd_extreme_comparisons)]
10211 #[allow(unused_comparisons)]
10212 if __tmp.remaining() < Self::ENCODED_LEN {
10213 panic!(
10214 "buffer is too small (need {} bytes, but got {})",
10215 Self::ENCODED_LEN,
10216 __tmp.remaining(),
10217 )
10218 }
10219 __tmp.put_u16_le(self.message_rate);
10220 __tmp.put_u8(self.stream_id);
10221 __tmp.put_u8(self.on_off);
10222 if matches!(version, MavlinkVersion::V2) {
10223 let len = __tmp.len();
10224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10225 } else {
10226 __tmp.len()
10227 }
10228 }
10229}
10230#[doc = "id: 130"]
10231#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10232#[derive(Debug, Clone, PartialEq)]
10233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10235pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10236 #[doc = "total data size (set on ACK only)."]
10237 pub size: u32,
10238 #[doc = "Width of a matrix or image."]
10239 pub width: u16,
10240 #[doc = "Height of a matrix or image."]
10241 pub height: u16,
10242 #[doc = "Number of packets being sent (set on ACK only)."]
10243 pub packets: u16,
10244 #[doc = "Type of requested/acknowledged data."]
10245 pub mavtype: MavlinkDataStreamType,
10246 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10247 pub payload: u8,
10248 #[doc = "JPEG quality. Values: [1-100]."]
10249 pub jpg_quality: u8,
10250}
10251impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10252 pub const ENCODED_LEN: usize = 13usize;
10253 pub const DEFAULT: Self = Self {
10254 size: 0_u32,
10255 width: 0_u16,
10256 height: 0_u16,
10257 packets: 0_u16,
10258 mavtype: MavlinkDataStreamType::DEFAULT,
10259 payload: 0_u8,
10260 jpg_quality: 0_u8,
10261 };
10262 #[cfg(feature = "arbitrary")]
10263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10264 use arbitrary::{Arbitrary, Unstructured};
10265 let mut buf = [0u8; 1024];
10266 rng.fill_bytes(&mut buf);
10267 let mut unstructured = Unstructured::new(&buf);
10268 Self::arbitrary(&mut unstructured).unwrap_or_default()
10269 }
10270}
10271impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10272 fn default() -> Self {
10273 Self::DEFAULT.clone()
10274 }
10275}
10276impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10277 type Message = MavMessage;
10278 const ID: u32 = 130u32;
10279 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10280 const EXTRA_CRC: u8 = 29u8;
10281 const ENCODED_LEN: usize = 13usize;
10282 fn deser(
10283 _version: MavlinkVersion,
10284 __input: &[u8],
10285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10286 let avail_len = __input.len();
10287 let mut payload_buf = [0; Self::ENCODED_LEN];
10288 let mut buf = if avail_len < Self::ENCODED_LEN {
10289 payload_buf[0..avail_len].copy_from_slice(__input);
10290 Bytes::new(&payload_buf)
10291 } else {
10292 Bytes::new(__input)
10293 };
10294 let mut __struct = Self::default();
10295 __struct.size = buf.get_u32_le();
10296 __struct.width = buf.get_u16_le();
10297 __struct.height = buf.get_u16_le();
10298 __struct.packets = buf.get_u16_le();
10299 let tmp = buf.get_u8();
10300 __struct.mavtype =
10301 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10302 enum_type: "MavlinkDataStreamType",
10303 value: tmp as u32,
10304 })?;
10305 __struct.payload = buf.get_u8();
10306 __struct.jpg_quality = buf.get_u8();
10307 Ok(__struct)
10308 }
10309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10310 let mut __tmp = BytesMut::new(bytes);
10311 #[allow(clippy::absurd_extreme_comparisons)]
10312 #[allow(unused_comparisons)]
10313 if __tmp.remaining() < Self::ENCODED_LEN {
10314 panic!(
10315 "buffer is too small (need {} bytes, but got {})",
10316 Self::ENCODED_LEN,
10317 __tmp.remaining(),
10318 )
10319 }
10320 __tmp.put_u32_le(self.size);
10321 __tmp.put_u16_le(self.width);
10322 __tmp.put_u16_le(self.height);
10323 __tmp.put_u16_le(self.packets);
10324 __tmp.put_u8(self.mavtype as u8);
10325 __tmp.put_u8(self.payload);
10326 __tmp.put_u8(self.jpg_quality);
10327 if matches!(version, MavlinkVersion::V2) {
10328 let len = __tmp.len();
10329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10330 } else {
10331 __tmp.len()
10332 }
10333 }
10334}
10335#[doc = "id: 254"]
10336#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10337#[derive(Debug, Clone, PartialEq)]
10338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10340pub struct DEBUG_DATA {
10341 #[doc = "Timestamp (time since system boot)."]
10342 pub time_boot_ms: u32,
10343 #[doc = "DEBUG value"]
10344 pub value: f32,
10345 #[doc = "index of debug variable"]
10346 pub ind: u8,
10347}
10348impl DEBUG_DATA {
10349 pub const ENCODED_LEN: usize = 9usize;
10350 pub const DEFAULT: Self = Self {
10351 time_boot_ms: 0_u32,
10352 value: 0.0_f32,
10353 ind: 0_u8,
10354 };
10355 #[cfg(feature = "arbitrary")]
10356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10357 use arbitrary::{Arbitrary, Unstructured};
10358 let mut buf = [0u8; 1024];
10359 rng.fill_bytes(&mut buf);
10360 let mut unstructured = Unstructured::new(&buf);
10361 Self::arbitrary(&mut unstructured).unwrap_or_default()
10362 }
10363}
10364impl Default for DEBUG_DATA {
10365 fn default() -> Self {
10366 Self::DEFAULT.clone()
10367 }
10368}
10369impl MessageData for DEBUG_DATA {
10370 type Message = MavMessage;
10371 const ID: u32 = 254u32;
10372 const NAME: &'static str = "DEBUG";
10373 const EXTRA_CRC: u8 = 46u8;
10374 const ENCODED_LEN: usize = 9usize;
10375 fn deser(
10376 _version: MavlinkVersion,
10377 __input: &[u8],
10378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10379 let avail_len = __input.len();
10380 let mut payload_buf = [0; Self::ENCODED_LEN];
10381 let mut buf = if avail_len < Self::ENCODED_LEN {
10382 payload_buf[0..avail_len].copy_from_slice(__input);
10383 Bytes::new(&payload_buf)
10384 } else {
10385 Bytes::new(__input)
10386 };
10387 let mut __struct = Self::default();
10388 __struct.time_boot_ms = buf.get_u32_le();
10389 __struct.value = buf.get_f32_le();
10390 __struct.ind = buf.get_u8();
10391 Ok(__struct)
10392 }
10393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10394 let mut __tmp = BytesMut::new(bytes);
10395 #[allow(clippy::absurd_extreme_comparisons)]
10396 #[allow(unused_comparisons)]
10397 if __tmp.remaining() < Self::ENCODED_LEN {
10398 panic!(
10399 "buffer is too small (need {} bytes, but got {})",
10400 Self::ENCODED_LEN,
10401 __tmp.remaining(),
10402 )
10403 }
10404 __tmp.put_u32_le(self.time_boot_ms);
10405 __tmp.put_f32_le(self.value);
10406 __tmp.put_u8(self.ind);
10407 if matches!(version, MavlinkVersion::V2) {
10408 let len = __tmp.len();
10409 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10410 } else {
10411 __tmp.len()
10412 }
10413 }
10414}
10415#[doc = "id: 350"]
10416#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10417#[derive(Debug, Clone, PartialEq)]
10418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10420pub struct DEBUG_FLOAT_ARRAY_DATA {
10421 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10422 pub time_usec: u64,
10423 #[doc = "Unique ID used to discriminate between arrays"]
10424 pub array_id: u16,
10425 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10427 pub name: [u8; 10],
10428 #[doc = "data"]
10429 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10430 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10431 pub data: [f32; 58],
10432}
10433impl DEBUG_FLOAT_ARRAY_DATA {
10434 pub const ENCODED_LEN: usize = 252usize;
10435 pub const DEFAULT: Self = Self {
10436 time_usec: 0_u64,
10437 array_id: 0_u16,
10438 name: [0_u8; 10usize],
10439 data: [0.0_f32; 58usize],
10440 };
10441 #[cfg(feature = "arbitrary")]
10442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10443 use arbitrary::{Arbitrary, Unstructured};
10444 let mut buf = [0u8; 1024];
10445 rng.fill_bytes(&mut buf);
10446 let mut unstructured = Unstructured::new(&buf);
10447 Self::arbitrary(&mut unstructured).unwrap_or_default()
10448 }
10449}
10450impl Default for DEBUG_FLOAT_ARRAY_DATA {
10451 fn default() -> Self {
10452 Self::DEFAULT.clone()
10453 }
10454}
10455impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10456 type Message = MavMessage;
10457 const ID: u32 = 350u32;
10458 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10459 const EXTRA_CRC: u8 = 232u8;
10460 const ENCODED_LEN: usize = 252usize;
10461 fn deser(
10462 _version: MavlinkVersion,
10463 __input: &[u8],
10464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10465 let avail_len = __input.len();
10466 let mut payload_buf = [0; Self::ENCODED_LEN];
10467 let mut buf = if avail_len < Self::ENCODED_LEN {
10468 payload_buf[0..avail_len].copy_from_slice(__input);
10469 Bytes::new(&payload_buf)
10470 } else {
10471 Bytes::new(__input)
10472 };
10473 let mut __struct = Self::default();
10474 __struct.time_usec = buf.get_u64_le();
10475 __struct.array_id = buf.get_u16_le();
10476 for v in &mut __struct.name {
10477 let val = buf.get_u8();
10478 *v = val;
10479 }
10480 for v in &mut __struct.data {
10481 let val = buf.get_f32_le();
10482 *v = val;
10483 }
10484 Ok(__struct)
10485 }
10486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10487 let mut __tmp = BytesMut::new(bytes);
10488 #[allow(clippy::absurd_extreme_comparisons)]
10489 #[allow(unused_comparisons)]
10490 if __tmp.remaining() < Self::ENCODED_LEN {
10491 panic!(
10492 "buffer is too small (need {} bytes, but got {})",
10493 Self::ENCODED_LEN,
10494 __tmp.remaining(),
10495 )
10496 }
10497 __tmp.put_u64_le(self.time_usec);
10498 __tmp.put_u16_le(self.array_id);
10499 for val in &self.name {
10500 __tmp.put_u8(*val);
10501 }
10502 for val in &self.data {
10503 __tmp.put_f32_le(*val);
10504 }
10505 if matches!(version, MavlinkVersion::V2) {
10506 let len = __tmp.len();
10507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10508 } else {
10509 __tmp.len()
10510 }
10511 }
10512}
10513#[doc = "id: 250"]
10514#[doc = "To debug something using a named 3D vector."]
10515#[derive(Debug, Clone, PartialEq)]
10516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10517#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10518pub struct DEBUG_VECT_DATA {
10519 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10520 pub time_usec: u64,
10521 #[doc = "x"]
10522 pub x: f32,
10523 #[doc = "y"]
10524 pub y: f32,
10525 #[doc = "z"]
10526 pub z: f32,
10527 #[doc = "Name"]
10528 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10529 pub name: [u8; 10],
10530}
10531impl DEBUG_VECT_DATA {
10532 pub const ENCODED_LEN: usize = 30usize;
10533 pub const DEFAULT: Self = Self {
10534 time_usec: 0_u64,
10535 x: 0.0_f32,
10536 y: 0.0_f32,
10537 z: 0.0_f32,
10538 name: [0_u8; 10usize],
10539 };
10540 #[cfg(feature = "arbitrary")]
10541 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10542 use arbitrary::{Arbitrary, Unstructured};
10543 let mut buf = [0u8; 1024];
10544 rng.fill_bytes(&mut buf);
10545 let mut unstructured = Unstructured::new(&buf);
10546 Self::arbitrary(&mut unstructured).unwrap_or_default()
10547 }
10548}
10549impl Default for DEBUG_VECT_DATA {
10550 fn default() -> Self {
10551 Self::DEFAULT.clone()
10552 }
10553}
10554impl MessageData for DEBUG_VECT_DATA {
10555 type Message = MavMessage;
10556 const ID: u32 = 250u32;
10557 const NAME: &'static str = "DEBUG_VECT";
10558 const EXTRA_CRC: u8 = 49u8;
10559 const ENCODED_LEN: usize = 30usize;
10560 fn deser(
10561 _version: MavlinkVersion,
10562 __input: &[u8],
10563 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10564 let avail_len = __input.len();
10565 let mut payload_buf = [0; Self::ENCODED_LEN];
10566 let mut buf = if avail_len < Self::ENCODED_LEN {
10567 payload_buf[0..avail_len].copy_from_slice(__input);
10568 Bytes::new(&payload_buf)
10569 } else {
10570 Bytes::new(__input)
10571 };
10572 let mut __struct = Self::default();
10573 __struct.time_usec = buf.get_u64_le();
10574 __struct.x = buf.get_f32_le();
10575 __struct.y = buf.get_f32_le();
10576 __struct.z = buf.get_f32_le();
10577 for v in &mut __struct.name {
10578 let val = buf.get_u8();
10579 *v = val;
10580 }
10581 Ok(__struct)
10582 }
10583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10584 let mut __tmp = BytesMut::new(bytes);
10585 #[allow(clippy::absurd_extreme_comparisons)]
10586 #[allow(unused_comparisons)]
10587 if __tmp.remaining() < Self::ENCODED_LEN {
10588 panic!(
10589 "buffer is too small (need {} bytes, but got {})",
10590 Self::ENCODED_LEN,
10591 __tmp.remaining(),
10592 )
10593 }
10594 __tmp.put_u64_le(self.time_usec);
10595 __tmp.put_f32_le(self.x);
10596 __tmp.put_f32_le(self.y);
10597 __tmp.put_f32_le(self.z);
10598 for val in &self.name {
10599 __tmp.put_u8(*val);
10600 }
10601 if matches!(version, MavlinkVersion::V2) {
10602 let len = __tmp.len();
10603 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10604 } else {
10605 __tmp.len()
10606 }
10607 }
10608}
10609#[doc = "id: 132"]
10610#[doc = "Distance sensor information for an onboard rangefinder."]
10611#[derive(Debug, Clone, PartialEq)]
10612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10614pub struct DISTANCE_SENSOR_DATA {
10615 #[doc = "Timestamp (time since system boot)."]
10616 pub time_boot_ms: u32,
10617 #[doc = "Minimum distance the sensor can measure"]
10618 pub min_distance: u16,
10619 #[doc = "Maximum distance the sensor can measure"]
10620 pub max_distance: u16,
10621 #[doc = "Current distance reading"]
10622 pub current_distance: u16,
10623 #[doc = "Type of distance sensor."]
10624 pub mavtype: MavDistanceSensor,
10625 #[doc = "Onboard ID of the sensor"]
10626 pub id: u8,
10627 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10628 pub orientation: MavSensorOrientation,
10629 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10630 pub covariance: u8,
10631 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10633 pub horizontal_fov: f32,
10634 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10636 pub vertical_fov: f32,
10637 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10638 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10640 pub quaternion: [f32; 4],
10641 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10643 pub signal_quality: u8,
10644}
10645impl DISTANCE_SENSOR_DATA {
10646 pub const ENCODED_LEN: usize = 39usize;
10647 pub const DEFAULT: Self = Self {
10648 time_boot_ms: 0_u32,
10649 min_distance: 0_u16,
10650 max_distance: 0_u16,
10651 current_distance: 0_u16,
10652 mavtype: MavDistanceSensor::DEFAULT,
10653 id: 0_u8,
10654 orientation: MavSensorOrientation::DEFAULT,
10655 covariance: 0_u8,
10656 horizontal_fov: 0.0_f32,
10657 vertical_fov: 0.0_f32,
10658 quaternion: [0.0_f32; 4usize],
10659 signal_quality: 0_u8,
10660 };
10661 #[cfg(feature = "arbitrary")]
10662 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10663 use arbitrary::{Arbitrary, Unstructured};
10664 let mut buf = [0u8; 1024];
10665 rng.fill_bytes(&mut buf);
10666 let mut unstructured = Unstructured::new(&buf);
10667 Self::arbitrary(&mut unstructured).unwrap_or_default()
10668 }
10669}
10670impl Default for DISTANCE_SENSOR_DATA {
10671 fn default() -> Self {
10672 Self::DEFAULT.clone()
10673 }
10674}
10675impl MessageData for DISTANCE_SENSOR_DATA {
10676 type Message = MavMessage;
10677 const ID: u32 = 132u32;
10678 const NAME: &'static str = "DISTANCE_SENSOR";
10679 const EXTRA_CRC: u8 = 85u8;
10680 const ENCODED_LEN: usize = 39usize;
10681 fn deser(
10682 _version: MavlinkVersion,
10683 __input: &[u8],
10684 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10685 let avail_len = __input.len();
10686 let mut payload_buf = [0; Self::ENCODED_LEN];
10687 let mut buf = if avail_len < Self::ENCODED_LEN {
10688 payload_buf[0..avail_len].copy_from_slice(__input);
10689 Bytes::new(&payload_buf)
10690 } else {
10691 Bytes::new(__input)
10692 };
10693 let mut __struct = Self::default();
10694 __struct.time_boot_ms = buf.get_u32_le();
10695 __struct.min_distance = buf.get_u16_le();
10696 __struct.max_distance = buf.get_u16_le();
10697 __struct.current_distance = buf.get_u16_le();
10698 let tmp = buf.get_u8();
10699 __struct.mavtype =
10700 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10701 enum_type: "MavDistanceSensor",
10702 value: tmp as u32,
10703 })?;
10704 __struct.id = buf.get_u8();
10705 let tmp = buf.get_u8();
10706 __struct.orientation =
10707 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10708 enum_type: "MavSensorOrientation",
10709 value: tmp as u32,
10710 })?;
10711 __struct.covariance = buf.get_u8();
10712 __struct.horizontal_fov = buf.get_f32_le();
10713 __struct.vertical_fov = buf.get_f32_le();
10714 for v in &mut __struct.quaternion {
10715 let val = buf.get_f32_le();
10716 *v = val;
10717 }
10718 __struct.signal_quality = buf.get_u8();
10719 Ok(__struct)
10720 }
10721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10722 let mut __tmp = BytesMut::new(bytes);
10723 #[allow(clippy::absurd_extreme_comparisons)]
10724 #[allow(unused_comparisons)]
10725 if __tmp.remaining() < Self::ENCODED_LEN {
10726 panic!(
10727 "buffer is too small (need {} bytes, but got {})",
10728 Self::ENCODED_LEN,
10729 __tmp.remaining(),
10730 )
10731 }
10732 __tmp.put_u32_le(self.time_boot_ms);
10733 __tmp.put_u16_le(self.min_distance);
10734 __tmp.put_u16_le(self.max_distance);
10735 __tmp.put_u16_le(self.current_distance);
10736 __tmp.put_u8(self.mavtype as u8);
10737 __tmp.put_u8(self.id);
10738 __tmp.put_u8(self.orientation as u8);
10739 __tmp.put_u8(self.covariance);
10740 __tmp.put_f32_le(self.horizontal_fov);
10741 __tmp.put_f32_le(self.vertical_fov);
10742 for val in &self.quaternion {
10743 __tmp.put_f32_le(*val);
10744 }
10745 __tmp.put_u8(self.signal_quality);
10746 if matches!(version, MavlinkVersion::V2) {
10747 let len = __tmp.len();
10748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10749 } else {
10750 __tmp.len()
10751 }
10752 }
10753}
10754#[doc = "id: 225"]
10755#[doc = "EFI status output."]
10756#[derive(Debug, Clone, PartialEq)]
10757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10759pub struct EFI_STATUS_DATA {
10760 #[doc = "ECU index"]
10761 pub ecu_index: f32,
10762 #[doc = "RPM"]
10763 pub rpm: f32,
10764 #[doc = "Fuel consumed"]
10765 pub fuel_consumed: f32,
10766 #[doc = "Fuel flow rate"]
10767 pub fuel_flow: f32,
10768 #[doc = "Engine load"]
10769 pub engine_load: f32,
10770 #[doc = "Throttle position"]
10771 pub throttle_position: f32,
10772 #[doc = "Spark dwell time"]
10773 pub spark_dwell_time: f32,
10774 #[doc = "Barometric pressure"]
10775 pub barometric_pressure: f32,
10776 #[doc = "Intake manifold pressure("]
10777 pub intake_manifold_pressure: f32,
10778 #[doc = "Intake manifold temperature"]
10779 pub intake_manifold_temperature: f32,
10780 #[doc = "Cylinder head temperature"]
10781 pub cylinder_head_temperature: f32,
10782 #[doc = "Ignition timing (Crank angle degrees)"]
10783 pub ignition_timing: f32,
10784 #[doc = "Injection time"]
10785 pub injection_time: f32,
10786 #[doc = "Exhaust gas temperature"]
10787 pub exhaust_gas_temperature: f32,
10788 #[doc = "Output throttle"]
10789 pub throttle_out: f32,
10790 #[doc = "Pressure/temperature compensation"]
10791 pub pt_compensation: f32,
10792 #[doc = "EFI health status"]
10793 pub health: u8,
10794 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10795 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10796 pub ignition_voltage: f32,
10797 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10798 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10799 pub fuel_pressure: f32,
10800}
10801impl EFI_STATUS_DATA {
10802 pub const ENCODED_LEN: usize = 73usize;
10803 pub const DEFAULT: Self = Self {
10804 ecu_index: 0.0_f32,
10805 rpm: 0.0_f32,
10806 fuel_consumed: 0.0_f32,
10807 fuel_flow: 0.0_f32,
10808 engine_load: 0.0_f32,
10809 throttle_position: 0.0_f32,
10810 spark_dwell_time: 0.0_f32,
10811 barometric_pressure: 0.0_f32,
10812 intake_manifold_pressure: 0.0_f32,
10813 intake_manifold_temperature: 0.0_f32,
10814 cylinder_head_temperature: 0.0_f32,
10815 ignition_timing: 0.0_f32,
10816 injection_time: 0.0_f32,
10817 exhaust_gas_temperature: 0.0_f32,
10818 throttle_out: 0.0_f32,
10819 pt_compensation: 0.0_f32,
10820 health: 0_u8,
10821 ignition_voltage: 0.0_f32,
10822 fuel_pressure: 0.0_f32,
10823 };
10824 #[cfg(feature = "arbitrary")]
10825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10826 use arbitrary::{Arbitrary, Unstructured};
10827 let mut buf = [0u8; 1024];
10828 rng.fill_bytes(&mut buf);
10829 let mut unstructured = Unstructured::new(&buf);
10830 Self::arbitrary(&mut unstructured).unwrap_or_default()
10831 }
10832}
10833impl Default for EFI_STATUS_DATA {
10834 fn default() -> Self {
10835 Self::DEFAULT.clone()
10836 }
10837}
10838impl MessageData for EFI_STATUS_DATA {
10839 type Message = MavMessage;
10840 const ID: u32 = 225u32;
10841 const NAME: &'static str = "EFI_STATUS";
10842 const EXTRA_CRC: u8 = 208u8;
10843 const ENCODED_LEN: usize = 73usize;
10844 fn deser(
10845 _version: MavlinkVersion,
10846 __input: &[u8],
10847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10848 let avail_len = __input.len();
10849 let mut payload_buf = [0; Self::ENCODED_LEN];
10850 let mut buf = if avail_len < Self::ENCODED_LEN {
10851 payload_buf[0..avail_len].copy_from_slice(__input);
10852 Bytes::new(&payload_buf)
10853 } else {
10854 Bytes::new(__input)
10855 };
10856 let mut __struct = Self::default();
10857 __struct.ecu_index = buf.get_f32_le();
10858 __struct.rpm = buf.get_f32_le();
10859 __struct.fuel_consumed = buf.get_f32_le();
10860 __struct.fuel_flow = buf.get_f32_le();
10861 __struct.engine_load = buf.get_f32_le();
10862 __struct.throttle_position = buf.get_f32_le();
10863 __struct.spark_dwell_time = buf.get_f32_le();
10864 __struct.barometric_pressure = buf.get_f32_le();
10865 __struct.intake_manifold_pressure = buf.get_f32_le();
10866 __struct.intake_manifold_temperature = buf.get_f32_le();
10867 __struct.cylinder_head_temperature = buf.get_f32_le();
10868 __struct.ignition_timing = buf.get_f32_le();
10869 __struct.injection_time = buf.get_f32_le();
10870 __struct.exhaust_gas_temperature = buf.get_f32_le();
10871 __struct.throttle_out = buf.get_f32_le();
10872 __struct.pt_compensation = buf.get_f32_le();
10873 __struct.health = buf.get_u8();
10874 __struct.ignition_voltage = buf.get_f32_le();
10875 __struct.fuel_pressure = buf.get_f32_le();
10876 Ok(__struct)
10877 }
10878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10879 let mut __tmp = BytesMut::new(bytes);
10880 #[allow(clippy::absurd_extreme_comparisons)]
10881 #[allow(unused_comparisons)]
10882 if __tmp.remaining() < Self::ENCODED_LEN {
10883 panic!(
10884 "buffer is too small (need {} bytes, but got {})",
10885 Self::ENCODED_LEN,
10886 __tmp.remaining(),
10887 )
10888 }
10889 __tmp.put_f32_le(self.ecu_index);
10890 __tmp.put_f32_le(self.rpm);
10891 __tmp.put_f32_le(self.fuel_consumed);
10892 __tmp.put_f32_le(self.fuel_flow);
10893 __tmp.put_f32_le(self.engine_load);
10894 __tmp.put_f32_le(self.throttle_position);
10895 __tmp.put_f32_le(self.spark_dwell_time);
10896 __tmp.put_f32_le(self.barometric_pressure);
10897 __tmp.put_f32_le(self.intake_manifold_pressure);
10898 __tmp.put_f32_le(self.intake_manifold_temperature);
10899 __tmp.put_f32_le(self.cylinder_head_temperature);
10900 __tmp.put_f32_le(self.ignition_timing);
10901 __tmp.put_f32_le(self.injection_time);
10902 __tmp.put_f32_le(self.exhaust_gas_temperature);
10903 __tmp.put_f32_le(self.throttle_out);
10904 __tmp.put_f32_le(self.pt_compensation);
10905 __tmp.put_u8(self.health);
10906 __tmp.put_f32_le(self.ignition_voltage);
10907 __tmp.put_f32_le(self.fuel_pressure);
10908 if matches!(version, MavlinkVersion::V2) {
10909 let len = __tmp.len();
10910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10911 } else {
10912 __tmp.len()
10913 }
10914 }
10915}
10916#[doc = "id: 131"]
10917#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10918#[derive(Debug, Clone, PartialEq)]
10919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10921pub struct ENCAPSULATED_DATA_DATA {
10922 #[doc = "sequence number (starting with 0 on every transmission)"]
10923 pub seqnr: u16,
10924 #[doc = "image data bytes"]
10925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10926 pub data: [u8; 253],
10927}
10928impl ENCAPSULATED_DATA_DATA {
10929 pub const ENCODED_LEN: usize = 255usize;
10930 pub const DEFAULT: Self = Self {
10931 seqnr: 0_u16,
10932 data: [0_u8; 253usize],
10933 };
10934 #[cfg(feature = "arbitrary")]
10935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10936 use arbitrary::{Arbitrary, Unstructured};
10937 let mut buf = [0u8; 1024];
10938 rng.fill_bytes(&mut buf);
10939 let mut unstructured = Unstructured::new(&buf);
10940 Self::arbitrary(&mut unstructured).unwrap_or_default()
10941 }
10942}
10943impl Default for ENCAPSULATED_DATA_DATA {
10944 fn default() -> Self {
10945 Self::DEFAULT.clone()
10946 }
10947}
10948impl MessageData for ENCAPSULATED_DATA_DATA {
10949 type Message = MavMessage;
10950 const ID: u32 = 131u32;
10951 const NAME: &'static str = "ENCAPSULATED_DATA";
10952 const EXTRA_CRC: u8 = 223u8;
10953 const ENCODED_LEN: usize = 255usize;
10954 fn deser(
10955 _version: MavlinkVersion,
10956 __input: &[u8],
10957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10958 let avail_len = __input.len();
10959 let mut payload_buf = [0; Self::ENCODED_LEN];
10960 let mut buf = if avail_len < Self::ENCODED_LEN {
10961 payload_buf[0..avail_len].copy_from_slice(__input);
10962 Bytes::new(&payload_buf)
10963 } else {
10964 Bytes::new(__input)
10965 };
10966 let mut __struct = Self::default();
10967 __struct.seqnr = buf.get_u16_le();
10968 for v in &mut __struct.data {
10969 let val = buf.get_u8();
10970 *v = val;
10971 }
10972 Ok(__struct)
10973 }
10974 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10975 let mut __tmp = BytesMut::new(bytes);
10976 #[allow(clippy::absurd_extreme_comparisons)]
10977 #[allow(unused_comparisons)]
10978 if __tmp.remaining() < Self::ENCODED_LEN {
10979 panic!(
10980 "buffer is too small (need {} bytes, but got {})",
10981 Self::ENCODED_LEN,
10982 __tmp.remaining(),
10983 )
10984 }
10985 __tmp.put_u16_le(self.seqnr);
10986 for val in &self.data {
10987 __tmp.put_u8(*val);
10988 }
10989 if matches!(version, MavlinkVersion::V2) {
10990 let len = __tmp.len();
10991 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10992 } else {
10993 __tmp.len()
10994 }
10995 }
10996}
10997#[doc = "id: 290"]
10998#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10999#[derive(Debug, Clone, PartialEq)]
11000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11002pub struct ESC_INFO_DATA {
11003 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11004 pub time_usec: u64,
11005 #[doc = "Number of reported errors by each ESC since boot."]
11006 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11007 pub error_count: [u32; 4],
11008 #[doc = "Counter of data packets received."]
11009 pub counter: u16,
11010 #[doc = "Bitmap of ESC failure flags."]
11011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11012 pub failure_flags: [u16; 4],
11013 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11014 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11015 pub temperature: [i16; 4],
11016 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11017 pub index: u8,
11018 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11019 pub count: u8,
11020 #[doc = "Connection type protocol for all ESC."]
11021 pub connection_type: EscConnectionType,
11022 #[doc = "Information regarding online/offline status of each ESC."]
11023 pub info: u8,
11024}
11025impl ESC_INFO_DATA {
11026 pub const ENCODED_LEN: usize = 46usize;
11027 pub const DEFAULT: Self = Self {
11028 time_usec: 0_u64,
11029 error_count: [0_u32; 4usize],
11030 counter: 0_u16,
11031 failure_flags: [0_u16; 4usize],
11032 temperature: [0_i16; 4usize],
11033 index: 0_u8,
11034 count: 0_u8,
11035 connection_type: EscConnectionType::DEFAULT,
11036 info: 0_u8,
11037 };
11038 #[cfg(feature = "arbitrary")]
11039 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11040 use arbitrary::{Arbitrary, Unstructured};
11041 let mut buf = [0u8; 1024];
11042 rng.fill_bytes(&mut buf);
11043 let mut unstructured = Unstructured::new(&buf);
11044 Self::arbitrary(&mut unstructured).unwrap_or_default()
11045 }
11046}
11047impl Default for ESC_INFO_DATA {
11048 fn default() -> Self {
11049 Self::DEFAULT.clone()
11050 }
11051}
11052impl MessageData for ESC_INFO_DATA {
11053 type Message = MavMessage;
11054 const ID: u32 = 290u32;
11055 const NAME: &'static str = "ESC_INFO";
11056 const EXTRA_CRC: u8 = 251u8;
11057 const ENCODED_LEN: usize = 46usize;
11058 fn deser(
11059 _version: MavlinkVersion,
11060 __input: &[u8],
11061 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11062 let avail_len = __input.len();
11063 let mut payload_buf = [0; Self::ENCODED_LEN];
11064 let mut buf = if avail_len < Self::ENCODED_LEN {
11065 payload_buf[0..avail_len].copy_from_slice(__input);
11066 Bytes::new(&payload_buf)
11067 } else {
11068 Bytes::new(__input)
11069 };
11070 let mut __struct = Self::default();
11071 __struct.time_usec = buf.get_u64_le();
11072 for v in &mut __struct.error_count {
11073 let val = buf.get_u32_le();
11074 *v = val;
11075 }
11076 __struct.counter = buf.get_u16_le();
11077 for v in &mut __struct.failure_flags {
11078 let val = buf.get_u16_le();
11079 *v = val;
11080 }
11081 for v in &mut __struct.temperature {
11082 let val = buf.get_i16_le();
11083 *v = val;
11084 }
11085 __struct.index = buf.get_u8();
11086 __struct.count = buf.get_u8();
11087 let tmp = buf.get_u8();
11088 __struct.connection_type =
11089 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11090 enum_type: "EscConnectionType",
11091 value: tmp as u32,
11092 })?;
11093 __struct.info = buf.get_u8();
11094 Ok(__struct)
11095 }
11096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11097 let mut __tmp = BytesMut::new(bytes);
11098 #[allow(clippy::absurd_extreme_comparisons)]
11099 #[allow(unused_comparisons)]
11100 if __tmp.remaining() < Self::ENCODED_LEN {
11101 panic!(
11102 "buffer is too small (need {} bytes, but got {})",
11103 Self::ENCODED_LEN,
11104 __tmp.remaining(),
11105 )
11106 }
11107 __tmp.put_u64_le(self.time_usec);
11108 for val in &self.error_count {
11109 __tmp.put_u32_le(*val);
11110 }
11111 __tmp.put_u16_le(self.counter);
11112 for val in &self.failure_flags {
11113 __tmp.put_u16_le(*val);
11114 }
11115 for val in &self.temperature {
11116 __tmp.put_i16_le(*val);
11117 }
11118 __tmp.put_u8(self.index);
11119 __tmp.put_u8(self.count);
11120 __tmp.put_u8(self.connection_type as u8);
11121 __tmp.put_u8(self.info);
11122 if matches!(version, MavlinkVersion::V2) {
11123 let len = __tmp.len();
11124 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11125 } else {
11126 __tmp.len()
11127 }
11128 }
11129}
11130#[doc = "id: 291"]
11131#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11132#[derive(Debug, Clone, PartialEq)]
11133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11135pub struct ESC_STATUS_DATA {
11136 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11137 pub time_usec: u64,
11138 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11139 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11140 pub rpm: [i32; 4],
11141 #[doc = "Voltage measured from each ESC."]
11142 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11143 pub voltage: [f32; 4],
11144 #[doc = "Current measured from each ESC."]
11145 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11146 pub current: [f32; 4],
11147 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11148 pub index: u8,
11149}
11150impl ESC_STATUS_DATA {
11151 pub const ENCODED_LEN: usize = 57usize;
11152 pub const DEFAULT: Self = Self {
11153 time_usec: 0_u64,
11154 rpm: [0_i32; 4usize],
11155 voltage: [0.0_f32; 4usize],
11156 current: [0.0_f32; 4usize],
11157 index: 0_u8,
11158 };
11159 #[cfg(feature = "arbitrary")]
11160 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11161 use arbitrary::{Arbitrary, Unstructured};
11162 let mut buf = [0u8; 1024];
11163 rng.fill_bytes(&mut buf);
11164 let mut unstructured = Unstructured::new(&buf);
11165 Self::arbitrary(&mut unstructured).unwrap_or_default()
11166 }
11167}
11168impl Default for ESC_STATUS_DATA {
11169 fn default() -> Self {
11170 Self::DEFAULT.clone()
11171 }
11172}
11173impl MessageData for ESC_STATUS_DATA {
11174 type Message = MavMessage;
11175 const ID: u32 = 291u32;
11176 const NAME: &'static str = "ESC_STATUS";
11177 const EXTRA_CRC: u8 = 10u8;
11178 const ENCODED_LEN: usize = 57usize;
11179 fn deser(
11180 _version: MavlinkVersion,
11181 __input: &[u8],
11182 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11183 let avail_len = __input.len();
11184 let mut payload_buf = [0; Self::ENCODED_LEN];
11185 let mut buf = if avail_len < Self::ENCODED_LEN {
11186 payload_buf[0..avail_len].copy_from_slice(__input);
11187 Bytes::new(&payload_buf)
11188 } else {
11189 Bytes::new(__input)
11190 };
11191 let mut __struct = Self::default();
11192 __struct.time_usec = buf.get_u64_le();
11193 for v in &mut __struct.rpm {
11194 let val = buf.get_i32_le();
11195 *v = val;
11196 }
11197 for v in &mut __struct.voltage {
11198 let val = buf.get_f32_le();
11199 *v = val;
11200 }
11201 for v in &mut __struct.current {
11202 let val = buf.get_f32_le();
11203 *v = val;
11204 }
11205 __struct.index = buf.get_u8();
11206 Ok(__struct)
11207 }
11208 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11209 let mut __tmp = BytesMut::new(bytes);
11210 #[allow(clippy::absurd_extreme_comparisons)]
11211 #[allow(unused_comparisons)]
11212 if __tmp.remaining() < Self::ENCODED_LEN {
11213 panic!(
11214 "buffer is too small (need {} bytes, but got {})",
11215 Self::ENCODED_LEN,
11216 __tmp.remaining(),
11217 )
11218 }
11219 __tmp.put_u64_le(self.time_usec);
11220 for val in &self.rpm {
11221 __tmp.put_i32_le(*val);
11222 }
11223 for val in &self.voltage {
11224 __tmp.put_f32_le(*val);
11225 }
11226 for val in &self.current {
11227 __tmp.put_f32_le(*val);
11228 }
11229 __tmp.put_u8(self.index);
11230 if matches!(version, MavlinkVersion::V2) {
11231 let len = __tmp.len();
11232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11233 } else {
11234 __tmp.len()
11235 }
11236 }
11237}
11238#[doc = "id: 230"]
11239#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11240#[derive(Debug, Clone, PartialEq)]
11241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11243pub struct ESTIMATOR_STATUS_DATA {
11244 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11245 pub time_usec: u64,
11246 #[doc = "Velocity innovation test ratio"]
11247 pub vel_ratio: f32,
11248 #[doc = "Horizontal position innovation test ratio"]
11249 pub pos_horiz_ratio: f32,
11250 #[doc = "Vertical position innovation test ratio"]
11251 pub pos_vert_ratio: f32,
11252 #[doc = "Magnetometer innovation test ratio"]
11253 pub mag_ratio: f32,
11254 #[doc = "Height above terrain innovation test ratio"]
11255 pub hagl_ratio: f32,
11256 #[doc = "True airspeed innovation test ratio"]
11257 pub tas_ratio: f32,
11258 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11259 pub pos_horiz_accuracy: f32,
11260 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11261 pub pos_vert_accuracy: f32,
11262 #[doc = "Bitmap indicating which EKF outputs are valid."]
11263 pub flags: EstimatorStatusFlags,
11264}
11265impl ESTIMATOR_STATUS_DATA {
11266 pub const ENCODED_LEN: usize = 42usize;
11267 pub const DEFAULT: Self = Self {
11268 time_usec: 0_u64,
11269 vel_ratio: 0.0_f32,
11270 pos_horiz_ratio: 0.0_f32,
11271 pos_vert_ratio: 0.0_f32,
11272 mag_ratio: 0.0_f32,
11273 hagl_ratio: 0.0_f32,
11274 tas_ratio: 0.0_f32,
11275 pos_horiz_accuracy: 0.0_f32,
11276 pos_vert_accuracy: 0.0_f32,
11277 flags: EstimatorStatusFlags::DEFAULT,
11278 };
11279 #[cfg(feature = "arbitrary")]
11280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11281 use arbitrary::{Arbitrary, Unstructured};
11282 let mut buf = [0u8; 1024];
11283 rng.fill_bytes(&mut buf);
11284 let mut unstructured = Unstructured::new(&buf);
11285 Self::arbitrary(&mut unstructured).unwrap_or_default()
11286 }
11287}
11288impl Default for ESTIMATOR_STATUS_DATA {
11289 fn default() -> Self {
11290 Self::DEFAULT.clone()
11291 }
11292}
11293impl MessageData for ESTIMATOR_STATUS_DATA {
11294 type Message = MavMessage;
11295 const ID: u32 = 230u32;
11296 const NAME: &'static str = "ESTIMATOR_STATUS";
11297 const EXTRA_CRC: u8 = 163u8;
11298 const ENCODED_LEN: usize = 42usize;
11299 fn deser(
11300 _version: MavlinkVersion,
11301 __input: &[u8],
11302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11303 let avail_len = __input.len();
11304 let mut payload_buf = [0; Self::ENCODED_LEN];
11305 let mut buf = if avail_len < Self::ENCODED_LEN {
11306 payload_buf[0..avail_len].copy_from_slice(__input);
11307 Bytes::new(&payload_buf)
11308 } else {
11309 Bytes::new(__input)
11310 };
11311 let mut __struct = Self::default();
11312 __struct.time_usec = buf.get_u64_le();
11313 __struct.vel_ratio = buf.get_f32_le();
11314 __struct.pos_horiz_ratio = buf.get_f32_le();
11315 __struct.pos_vert_ratio = buf.get_f32_le();
11316 __struct.mag_ratio = buf.get_f32_le();
11317 __struct.hagl_ratio = buf.get_f32_le();
11318 __struct.tas_ratio = buf.get_f32_le();
11319 __struct.pos_horiz_accuracy = buf.get_f32_le();
11320 __struct.pos_vert_accuracy = buf.get_f32_le();
11321 let tmp = buf.get_u16_le();
11322 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11323 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11324 flag_type: "EstimatorStatusFlags",
11325 value: tmp as u32,
11326 })?;
11327 Ok(__struct)
11328 }
11329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11330 let mut __tmp = BytesMut::new(bytes);
11331 #[allow(clippy::absurd_extreme_comparisons)]
11332 #[allow(unused_comparisons)]
11333 if __tmp.remaining() < Self::ENCODED_LEN {
11334 panic!(
11335 "buffer is too small (need {} bytes, but got {})",
11336 Self::ENCODED_LEN,
11337 __tmp.remaining(),
11338 )
11339 }
11340 __tmp.put_u64_le(self.time_usec);
11341 __tmp.put_f32_le(self.vel_ratio);
11342 __tmp.put_f32_le(self.pos_horiz_ratio);
11343 __tmp.put_f32_le(self.pos_vert_ratio);
11344 __tmp.put_f32_le(self.mag_ratio);
11345 __tmp.put_f32_le(self.hagl_ratio);
11346 __tmp.put_f32_le(self.tas_ratio);
11347 __tmp.put_f32_le(self.pos_horiz_accuracy);
11348 __tmp.put_f32_le(self.pos_vert_accuracy);
11349 __tmp.put_u16_le(self.flags.bits());
11350 if matches!(version, MavlinkVersion::V2) {
11351 let len = __tmp.len();
11352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11353 } else {
11354 __tmp.len()
11355 }
11356 }
11357}
11358#[doc = "id: 410"]
11359#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11360#[derive(Debug, Clone, PartialEq)]
11361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11363pub struct EVENT_DATA {
11364 #[doc = "Event ID (as defined in the component metadata)"]
11365 pub id: u32,
11366 #[doc = "Timestamp (time since system boot when the event happened)."]
11367 pub event_time_boot_ms: u32,
11368 #[doc = "Sequence number."]
11369 pub sequence: u16,
11370 #[doc = "Component ID"]
11371 pub destination_component: u8,
11372 #[doc = "System ID"]
11373 pub destination_system: u8,
11374 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11375 pub log_levels: u8,
11376 #[doc = "Arguments (depend on event ID)."]
11377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11378 pub arguments: [u8; 40],
11379}
11380impl EVENT_DATA {
11381 pub const ENCODED_LEN: usize = 53usize;
11382 pub const DEFAULT: Self = Self {
11383 id: 0_u32,
11384 event_time_boot_ms: 0_u32,
11385 sequence: 0_u16,
11386 destination_component: 0_u8,
11387 destination_system: 0_u8,
11388 log_levels: 0_u8,
11389 arguments: [0_u8; 40usize],
11390 };
11391 #[cfg(feature = "arbitrary")]
11392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11393 use arbitrary::{Arbitrary, Unstructured};
11394 let mut buf = [0u8; 1024];
11395 rng.fill_bytes(&mut buf);
11396 let mut unstructured = Unstructured::new(&buf);
11397 Self::arbitrary(&mut unstructured).unwrap_or_default()
11398 }
11399}
11400impl Default for EVENT_DATA {
11401 fn default() -> Self {
11402 Self::DEFAULT.clone()
11403 }
11404}
11405impl MessageData for EVENT_DATA {
11406 type Message = MavMessage;
11407 const ID: u32 = 410u32;
11408 const NAME: &'static str = "EVENT";
11409 const EXTRA_CRC: u8 = 160u8;
11410 const ENCODED_LEN: usize = 53usize;
11411 fn deser(
11412 _version: MavlinkVersion,
11413 __input: &[u8],
11414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11415 let avail_len = __input.len();
11416 let mut payload_buf = [0; Self::ENCODED_LEN];
11417 let mut buf = if avail_len < Self::ENCODED_LEN {
11418 payload_buf[0..avail_len].copy_from_slice(__input);
11419 Bytes::new(&payload_buf)
11420 } else {
11421 Bytes::new(__input)
11422 };
11423 let mut __struct = Self::default();
11424 __struct.id = buf.get_u32_le();
11425 __struct.event_time_boot_ms = buf.get_u32_le();
11426 __struct.sequence = buf.get_u16_le();
11427 __struct.destination_component = buf.get_u8();
11428 __struct.destination_system = buf.get_u8();
11429 __struct.log_levels = buf.get_u8();
11430 for v in &mut __struct.arguments {
11431 let val = buf.get_u8();
11432 *v = val;
11433 }
11434 Ok(__struct)
11435 }
11436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11437 let mut __tmp = BytesMut::new(bytes);
11438 #[allow(clippy::absurd_extreme_comparisons)]
11439 #[allow(unused_comparisons)]
11440 if __tmp.remaining() < Self::ENCODED_LEN {
11441 panic!(
11442 "buffer is too small (need {} bytes, but got {})",
11443 Self::ENCODED_LEN,
11444 __tmp.remaining(),
11445 )
11446 }
11447 __tmp.put_u32_le(self.id);
11448 __tmp.put_u32_le(self.event_time_boot_ms);
11449 __tmp.put_u16_le(self.sequence);
11450 __tmp.put_u8(self.destination_component);
11451 __tmp.put_u8(self.destination_system);
11452 __tmp.put_u8(self.log_levels);
11453 for val in &self.arguments {
11454 __tmp.put_u8(*val);
11455 }
11456 if matches!(version, MavlinkVersion::V2) {
11457 let len = __tmp.len();
11458 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11459 } else {
11460 __tmp.len()
11461 }
11462 }
11463}
11464#[doc = "id: 245"]
11465#[doc = "Provides state for additional features."]
11466#[derive(Debug, Clone, PartialEq)]
11467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11468#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11469pub struct EXTENDED_SYS_STATE_DATA {
11470 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11471 pub vtol_state: MavVtolState,
11472 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11473 pub landed_state: MavLandedState,
11474}
11475impl EXTENDED_SYS_STATE_DATA {
11476 pub const ENCODED_LEN: usize = 2usize;
11477 pub const DEFAULT: Self = Self {
11478 vtol_state: MavVtolState::DEFAULT,
11479 landed_state: MavLandedState::DEFAULT,
11480 };
11481 #[cfg(feature = "arbitrary")]
11482 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11483 use arbitrary::{Arbitrary, Unstructured};
11484 let mut buf = [0u8; 1024];
11485 rng.fill_bytes(&mut buf);
11486 let mut unstructured = Unstructured::new(&buf);
11487 Self::arbitrary(&mut unstructured).unwrap_or_default()
11488 }
11489}
11490impl Default for EXTENDED_SYS_STATE_DATA {
11491 fn default() -> Self {
11492 Self::DEFAULT.clone()
11493 }
11494}
11495impl MessageData for EXTENDED_SYS_STATE_DATA {
11496 type Message = MavMessage;
11497 const ID: u32 = 245u32;
11498 const NAME: &'static str = "EXTENDED_SYS_STATE";
11499 const EXTRA_CRC: u8 = 130u8;
11500 const ENCODED_LEN: usize = 2usize;
11501 fn deser(
11502 _version: MavlinkVersion,
11503 __input: &[u8],
11504 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11505 let avail_len = __input.len();
11506 let mut payload_buf = [0; Self::ENCODED_LEN];
11507 let mut buf = if avail_len < Self::ENCODED_LEN {
11508 payload_buf[0..avail_len].copy_from_slice(__input);
11509 Bytes::new(&payload_buf)
11510 } else {
11511 Bytes::new(__input)
11512 };
11513 let mut __struct = Self::default();
11514 let tmp = buf.get_u8();
11515 __struct.vtol_state =
11516 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11517 enum_type: "MavVtolState",
11518 value: tmp as u32,
11519 })?;
11520 let tmp = buf.get_u8();
11521 __struct.landed_state =
11522 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11523 enum_type: "MavLandedState",
11524 value: tmp as u32,
11525 })?;
11526 Ok(__struct)
11527 }
11528 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11529 let mut __tmp = BytesMut::new(bytes);
11530 #[allow(clippy::absurd_extreme_comparisons)]
11531 #[allow(unused_comparisons)]
11532 if __tmp.remaining() < Self::ENCODED_LEN {
11533 panic!(
11534 "buffer is too small (need {} bytes, but got {})",
11535 Self::ENCODED_LEN,
11536 __tmp.remaining(),
11537 )
11538 }
11539 __tmp.put_u8(self.vtol_state as u8);
11540 __tmp.put_u8(self.landed_state as u8);
11541 if matches!(version, MavlinkVersion::V2) {
11542 let len = __tmp.len();
11543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11544 } else {
11545 __tmp.len()
11546 }
11547 }
11548}
11549#[doc = "id: 162"]
11550#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11551#[derive(Debug, Clone, PartialEq)]
11552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11554pub struct FENCE_STATUS_DATA {
11555 #[doc = "Time (since boot) of last breach."]
11556 pub breach_time: u32,
11557 #[doc = "Number of fence breaches."]
11558 pub breach_count: u16,
11559 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11560 pub breach_status: u8,
11561 #[doc = "Last breach type."]
11562 pub breach_type: FenceBreach,
11563 #[doc = "Active action to prevent fence breach"]
11564 #[cfg_attr(feature = "serde", serde(default))]
11565 pub breach_mitigation: FenceMitigate,
11566}
11567impl FENCE_STATUS_DATA {
11568 pub const ENCODED_LEN: usize = 9usize;
11569 pub const DEFAULT: Self = Self {
11570 breach_time: 0_u32,
11571 breach_count: 0_u16,
11572 breach_status: 0_u8,
11573 breach_type: FenceBreach::DEFAULT,
11574 breach_mitigation: FenceMitigate::DEFAULT,
11575 };
11576 #[cfg(feature = "arbitrary")]
11577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11578 use arbitrary::{Arbitrary, Unstructured};
11579 let mut buf = [0u8; 1024];
11580 rng.fill_bytes(&mut buf);
11581 let mut unstructured = Unstructured::new(&buf);
11582 Self::arbitrary(&mut unstructured).unwrap_or_default()
11583 }
11584}
11585impl Default for FENCE_STATUS_DATA {
11586 fn default() -> Self {
11587 Self::DEFAULT.clone()
11588 }
11589}
11590impl MessageData for FENCE_STATUS_DATA {
11591 type Message = MavMessage;
11592 const ID: u32 = 162u32;
11593 const NAME: &'static str = "FENCE_STATUS";
11594 const EXTRA_CRC: u8 = 189u8;
11595 const ENCODED_LEN: usize = 9usize;
11596 fn deser(
11597 _version: MavlinkVersion,
11598 __input: &[u8],
11599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11600 let avail_len = __input.len();
11601 let mut payload_buf = [0; Self::ENCODED_LEN];
11602 let mut buf = if avail_len < Self::ENCODED_LEN {
11603 payload_buf[0..avail_len].copy_from_slice(__input);
11604 Bytes::new(&payload_buf)
11605 } else {
11606 Bytes::new(__input)
11607 };
11608 let mut __struct = Self::default();
11609 __struct.breach_time = buf.get_u32_le();
11610 __struct.breach_count = buf.get_u16_le();
11611 __struct.breach_status = buf.get_u8();
11612 let tmp = buf.get_u8();
11613 __struct.breach_type =
11614 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11615 enum_type: "FenceBreach",
11616 value: tmp as u32,
11617 })?;
11618 let tmp = buf.get_u8();
11619 __struct.breach_mitigation =
11620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11621 enum_type: "FenceMitigate",
11622 value: tmp as u32,
11623 })?;
11624 Ok(__struct)
11625 }
11626 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11627 let mut __tmp = BytesMut::new(bytes);
11628 #[allow(clippy::absurd_extreme_comparisons)]
11629 #[allow(unused_comparisons)]
11630 if __tmp.remaining() < Self::ENCODED_LEN {
11631 panic!(
11632 "buffer is too small (need {} bytes, but got {})",
11633 Self::ENCODED_LEN,
11634 __tmp.remaining(),
11635 )
11636 }
11637 __tmp.put_u32_le(self.breach_time);
11638 __tmp.put_u16_le(self.breach_count);
11639 __tmp.put_u8(self.breach_status);
11640 __tmp.put_u8(self.breach_type as u8);
11641 __tmp.put_u8(self.breach_mitigation as u8);
11642 if matches!(version, MavlinkVersion::V2) {
11643 let len = __tmp.len();
11644 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11645 } else {
11646 __tmp.len()
11647 }
11648 }
11649}
11650#[doc = "id: 110"]
11651#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11652#[derive(Debug, Clone, PartialEq)]
11653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11655pub struct FILE_TRANSFER_PROTOCOL_DATA {
11656 #[doc = "Network ID (0 for broadcast)"]
11657 pub target_network: u8,
11658 #[doc = "System ID (0 for broadcast)"]
11659 pub target_system: u8,
11660 #[doc = "Component ID (0 for broadcast)"]
11661 pub target_component: u8,
11662 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11663 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11664 pub payload: [u8; 251],
11665}
11666impl FILE_TRANSFER_PROTOCOL_DATA {
11667 pub const ENCODED_LEN: usize = 254usize;
11668 pub const DEFAULT: Self = Self {
11669 target_network: 0_u8,
11670 target_system: 0_u8,
11671 target_component: 0_u8,
11672 payload: [0_u8; 251usize],
11673 };
11674 #[cfg(feature = "arbitrary")]
11675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11676 use arbitrary::{Arbitrary, Unstructured};
11677 let mut buf = [0u8; 1024];
11678 rng.fill_bytes(&mut buf);
11679 let mut unstructured = Unstructured::new(&buf);
11680 Self::arbitrary(&mut unstructured).unwrap_or_default()
11681 }
11682}
11683impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11684 fn default() -> Self {
11685 Self::DEFAULT.clone()
11686 }
11687}
11688impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11689 type Message = MavMessage;
11690 const ID: u32 = 110u32;
11691 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11692 const EXTRA_CRC: u8 = 84u8;
11693 const ENCODED_LEN: usize = 254usize;
11694 fn deser(
11695 _version: MavlinkVersion,
11696 __input: &[u8],
11697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11698 let avail_len = __input.len();
11699 let mut payload_buf = [0; Self::ENCODED_LEN];
11700 let mut buf = if avail_len < Self::ENCODED_LEN {
11701 payload_buf[0..avail_len].copy_from_slice(__input);
11702 Bytes::new(&payload_buf)
11703 } else {
11704 Bytes::new(__input)
11705 };
11706 let mut __struct = Self::default();
11707 __struct.target_network = buf.get_u8();
11708 __struct.target_system = buf.get_u8();
11709 __struct.target_component = buf.get_u8();
11710 for v in &mut __struct.payload {
11711 let val = buf.get_u8();
11712 *v = val;
11713 }
11714 Ok(__struct)
11715 }
11716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11717 let mut __tmp = BytesMut::new(bytes);
11718 #[allow(clippy::absurd_extreme_comparisons)]
11719 #[allow(unused_comparisons)]
11720 if __tmp.remaining() < Self::ENCODED_LEN {
11721 panic!(
11722 "buffer is too small (need {} bytes, but got {})",
11723 Self::ENCODED_LEN,
11724 __tmp.remaining(),
11725 )
11726 }
11727 __tmp.put_u8(self.target_network);
11728 __tmp.put_u8(self.target_system);
11729 __tmp.put_u8(self.target_component);
11730 for val in &self.payload {
11731 __tmp.put_u8(*val);
11732 }
11733 if matches!(version, MavlinkVersion::V2) {
11734 let len = __tmp.len();
11735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11736 } else {
11737 __tmp.len()
11738 }
11739 }
11740}
11741#[doc = "id: 264"]
11742#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11743#[derive(Debug, Clone, PartialEq)]
11744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11746pub struct FLIGHT_INFORMATION_DATA {
11747 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11748 pub arming_time_utc: u64,
11749 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11750 pub takeoff_time_utc: u64,
11751 #[doc = "Flight number. Note, field is misnamed UUID."]
11752 pub flight_uuid: u64,
11753 #[doc = "Timestamp (time since system boot)."]
11754 pub time_boot_ms: u32,
11755 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11757 pub landing_time: u32,
11758}
11759impl FLIGHT_INFORMATION_DATA {
11760 pub const ENCODED_LEN: usize = 32usize;
11761 pub const DEFAULT: Self = Self {
11762 arming_time_utc: 0_u64,
11763 takeoff_time_utc: 0_u64,
11764 flight_uuid: 0_u64,
11765 time_boot_ms: 0_u32,
11766 landing_time: 0_u32,
11767 };
11768 #[cfg(feature = "arbitrary")]
11769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11770 use arbitrary::{Arbitrary, Unstructured};
11771 let mut buf = [0u8; 1024];
11772 rng.fill_bytes(&mut buf);
11773 let mut unstructured = Unstructured::new(&buf);
11774 Self::arbitrary(&mut unstructured).unwrap_or_default()
11775 }
11776}
11777impl Default for FLIGHT_INFORMATION_DATA {
11778 fn default() -> Self {
11779 Self::DEFAULT.clone()
11780 }
11781}
11782impl MessageData for FLIGHT_INFORMATION_DATA {
11783 type Message = MavMessage;
11784 const ID: u32 = 264u32;
11785 const NAME: &'static str = "FLIGHT_INFORMATION";
11786 const EXTRA_CRC: u8 = 49u8;
11787 const ENCODED_LEN: usize = 32usize;
11788 fn deser(
11789 _version: MavlinkVersion,
11790 __input: &[u8],
11791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11792 let avail_len = __input.len();
11793 let mut payload_buf = [0; Self::ENCODED_LEN];
11794 let mut buf = if avail_len < Self::ENCODED_LEN {
11795 payload_buf[0..avail_len].copy_from_slice(__input);
11796 Bytes::new(&payload_buf)
11797 } else {
11798 Bytes::new(__input)
11799 };
11800 let mut __struct = Self::default();
11801 __struct.arming_time_utc = buf.get_u64_le();
11802 __struct.takeoff_time_utc = buf.get_u64_le();
11803 __struct.flight_uuid = buf.get_u64_le();
11804 __struct.time_boot_ms = buf.get_u32_le();
11805 __struct.landing_time = buf.get_u32_le();
11806 Ok(__struct)
11807 }
11808 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11809 let mut __tmp = BytesMut::new(bytes);
11810 #[allow(clippy::absurd_extreme_comparisons)]
11811 #[allow(unused_comparisons)]
11812 if __tmp.remaining() < Self::ENCODED_LEN {
11813 panic!(
11814 "buffer is too small (need {} bytes, but got {})",
11815 Self::ENCODED_LEN,
11816 __tmp.remaining(),
11817 )
11818 }
11819 __tmp.put_u64_le(self.arming_time_utc);
11820 __tmp.put_u64_le(self.takeoff_time_utc);
11821 __tmp.put_u64_le(self.flight_uuid);
11822 __tmp.put_u32_le(self.time_boot_ms);
11823 __tmp.put_u32_le(self.landing_time);
11824 if matches!(version, MavlinkVersion::V2) {
11825 let len = __tmp.len();
11826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11827 } else {
11828 __tmp.len()
11829 }
11830 }
11831}
11832#[doc = "id: 144"]
11833#[doc = "Current motion information from a designated system."]
11834#[derive(Debug, Clone, PartialEq)]
11835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11837pub struct FOLLOW_TARGET_DATA {
11838 #[doc = "Timestamp (time since system boot)."]
11839 pub timestamp: u64,
11840 #[doc = "button states or switches of a tracker device"]
11841 pub custom_state: u64,
11842 #[doc = "Latitude (WGS84)"]
11843 pub lat: i32,
11844 #[doc = "Longitude (WGS84)"]
11845 pub lon: i32,
11846 #[doc = "Altitude (MSL)"]
11847 pub alt: f32,
11848 #[doc = "target velocity (0,0,0) for unknown"]
11849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11850 pub vel: [f32; 3],
11851 #[doc = "linear target acceleration (0,0,0) for unknown"]
11852 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11853 pub acc: [f32; 3],
11854 #[doc = "(0 0 0 0 for unknown)"]
11855 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11856 pub attitude_q: [f32; 4],
11857 #[doc = "(0 0 0 for unknown)"]
11858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11859 pub rates: [f32; 3],
11860 #[doc = "eph epv"]
11861 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11862 pub position_cov: [f32; 3],
11863 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11864 pub est_capabilities: u8,
11865}
11866impl FOLLOW_TARGET_DATA {
11867 pub const ENCODED_LEN: usize = 93usize;
11868 pub const DEFAULT: Self = Self {
11869 timestamp: 0_u64,
11870 custom_state: 0_u64,
11871 lat: 0_i32,
11872 lon: 0_i32,
11873 alt: 0.0_f32,
11874 vel: [0.0_f32; 3usize],
11875 acc: [0.0_f32; 3usize],
11876 attitude_q: [0.0_f32; 4usize],
11877 rates: [0.0_f32; 3usize],
11878 position_cov: [0.0_f32; 3usize],
11879 est_capabilities: 0_u8,
11880 };
11881 #[cfg(feature = "arbitrary")]
11882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11883 use arbitrary::{Arbitrary, Unstructured};
11884 let mut buf = [0u8; 1024];
11885 rng.fill_bytes(&mut buf);
11886 let mut unstructured = Unstructured::new(&buf);
11887 Self::arbitrary(&mut unstructured).unwrap_or_default()
11888 }
11889}
11890impl Default for FOLLOW_TARGET_DATA {
11891 fn default() -> Self {
11892 Self::DEFAULT.clone()
11893 }
11894}
11895impl MessageData for FOLLOW_TARGET_DATA {
11896 type Message = MavMessage;
11897 const ID: u32 = 144u32;
11898 const NAME: &'static str = "FOLLOW_TARGET";
11899 const EXTRA_CRC: u8 = 127u8;
11900 const ENCODED_LEN: usize = 93usize;
11901 fn deser(
11902 _version: MavlinkVersion,
11903 __input: &[u8],
11904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11905 let avail_len = __input.len();
11906 let mut payload_buf = [0; Self::ENCODED_LEN];
11907 let mut buf = if avail_len < Self::ENCODED_LEN {
11908 payload_buf[0..avail_len].copy_from_slice(__input);
11909 Bytes::new(&payload_buf)
11910 } else {
11911 Bytes::new(__input)
11912 };
11913 let mut __struct = Self::default();
11914 __struct.timestamp = buf.get_u64_le();
11915 __struct.custom_state = buf.get_u64_le();
11916 __struct.lat = buf.get_i32_le();
11917 __struct.lon = buf.get_i32_le();
11918 __struct.alt = buf.get_f32_le();
11919 for v in &mut __struct.vel {
11920 let val = buf.get_f32_le();
11921 *v = val;
11922 }
11923 for v in &mut __struct.acc {
11924 let val = buf.get_f32_le();
11925 *v = val;
11926 }
11927 for v in &mut __struct.attitude_q {
11928 let val = buf.get_f32_le();
11929 *v = val;
11930 }
11931 for v in &mut __struct.rates {
11932 let val = buf.get_f32_le();
11933 *v = val;
11934 }
11935 for v in &mut __struct.position_cov {
11936 let val = buf.get_f32_le();
11937 *v = val;
11938 }
11939 __struct.est_capabilities = buf.get_u8();
11940 Ok(__struct)
11941 }
11942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11943 let mut __tmp = BytesMut::new(bytes);
11944 #[allow(clippy::absurd_extreme_comparisons)]
11945 #[allow(unused_comparisons)]
11946 if __tmp.remaining() < Self::ENCODED_LEN {
11947 panic!(
11948 "buffer is too small (need {} bytes, but got {})",
11949 Self::ENCODED_LEN,
11950 __tmp.remaining(),
11951 )
11952 }
11953 __tmp.put_u64_le(self.timestamp);
11954 __tmp.put_u64_le(self.custom_state);
11955 __tmp.put_i32_le(self.lat);
11956 __tmp.put_i32_le(self.lon);
11957 __tmp.put_f32_le(self.alt);
11958 for val in &self.vel {
11959 __tmp.put_f32_le(*val);
11960 }
11961 for val in &self.acc {
11962 __tmp.put_f32_le(*val);
11963 }
11964 for val in &self.attitude_q {
11965 __tmp.put_f32_le(*val);
11966 }
11967 for val in &self.rates {
11968 __tmp.put_f32_le(*val);
11969 }
11970 for val in &self.position_cov {
11971 __tmp.put_f32_le(*val);
11972 }
11973 __tmp.put_u8(self.est_capabilities);
11974 if matches!(version, MavlinkVersion::V2) {
11975 let len = __tmp.len();
11976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11977 } else {
11978 __tmp.len()
11979 }
11980 }
11981}
11982#[doc = "id: 371"]
11983#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11984#[derive(Debug, Clone, PartialEq)]
11985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11987pub struct FUEL_STATUS_DATA {
11988 #[doc = "Capacity when full. Must be provided."]
11989 pub maximum_fuel: f32,
11990 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11991 pub consumed_fuel: f32,
11992 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11993 pub remaining_fuel: f32,
11994 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11995 pub flow_rate: f32,
11996 #[doc = "Fuel temperature. NaN: field not provided."]
11997 pub temperature: f32,
11998 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11999 pub fuel_type: MavFuelType,
12000 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12001 pub id: u8,
12002 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12003 pub percent_remaining: u8,
12004}
12005impl FUEL_STATUS_DATA {
12006 pub const ENCODED_LEN: usize = 26usize;
12007 pub const DEFAULT: Self = Self {
12008 maximum_fuel: 0.0_f32,
12009 consumed_fuel: 0.0_f32,
12010 remaining_fuel: 0.0_f32,
12011 flow_rate: 0.0_f32,
12012 temperature: 0.0_f32,
12013 fuel_type: MavFuelType::DEFAULT,
12014 id: 0_u8,
12015 percent_remaining: 0_u8,
12016 };
12017 #[cfg(feature = "arbitrary")]
12018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12019 use arbitrary::{Arbitrary, Unstructured};
12020 let mut buf = [0u8; 1024];
12021 rng.fill_bytes(&mut buf);
12022 let mut unstructured = Unstructured::new(&buf);
12023 Self::arbitrary(&mut unstructured).unwrap_or_default()
12024 }
12025}
12026impl Default for FUEL_STATUS_DATA {
12027 fn default() -> Self {
12028 Self::DEFAULT.clone()
12029 }
12030}
12031impl MessageData for FUEL_STATUS_DATA {
12032 type Message = MavMessage;
12033 const ID: u32 = 371u32;
12034 const NAME: &'static str = "FUEL_STATUS";
12035 const EXTRA_CRC: u8 = 10u8;
12036 const ENCODED_LEN: usize = 26usize;
12037 fn deser(
12038 _version: MavlinkVersion,
12039 __input: &[u8],
12040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12041 let avail_len = __input.len();
12042 let mut payload_buf = [0; Self::ENCODED_LEN];
12043 let mut buf = if avail_len < Self::ENCODED_LEN {
12044 payload_buf[0..avail_len].copy_from_slice(__input);
12045 Bytes::new(&payload_buf)
12046 } else {
12047 Bytes::new(__input)
12048 };
12049 let mut __struct = Self::default();
12050 __struct.maximum_fuel = buf.get_f32_le();
12051 __struct.consumed_fuel = buf.get_f32_le();
12052 __struct.remaining_fuel = buf.get_f32_le();
12053 __struct.flow_rate = buf.get_f32_le();
12054 __struct.temperature = buf.get_f32_le();
12055 let tmp = buf.get_u32_le();
12056 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12057 ::mavlink_core::error::ParserError::InvalidEnum {
12058 enum_type: "MavFuelType",
12059 value: tmp as u32,
12060 },
12061 )?;
12062 __struct.id = buf.get_u8();
12063 __struct.percent_remaining = buf.get_u8();
12064 Ok(__struct)
12065 }
12066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12067 let mut __tmp = BytesMut::new(bytes);
12068 #[allow(clippy::absurd_extreme_comparisons)]
12069 #[allow(unused_comparisons)]
12070 if __tmp.remaining() < Self::ENCODED_LEN {
12071 panic!(
12072 "buffer is too small (need {} bytes, but got {})",
12073 Self::ENCODED_LEN,
12074 __tmp.remaining(),
12075 )
12076 }
12077 __tmp.put_f32_le(self.maximum_fuel);
12078 __tmp.put_f32_le(self.consumed_fuel);
12079 __tmp.put_f32_le(self.remaining_fuel);
12080 __tmp.put_f32_le(self.flow_rate);
12081 __tmp.put_f32_le(self.temperature);
12082 __tmp.put_u32_le(self.fuel_type as u32);
12083 __tmp.put_u8(self.id);
12084 __tmp.put_u8(self.percent_remaining);
12085 if matches!(version, MavlinkVersion::V2) {
12086 let len = __tmp.len();
12087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12088 } else {
12089 __tmp.len()
12090 }
12091 }
12092}
12093#[doc = "id: 373"]
12094#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12095#[derive(Debug, Clone, PartialEq)]
12096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12098pub struct GENERATOR_STATUS_DATA {
12099 #[doc = "Status flags."]
12100 pub status: MavGeneratorStatusFlag,
12101 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12102 pub battery_current: f32,
12103 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12104 pub load_current: f32,
12105 #[doc = "The power being generated. NaN: field not provided"]
12106 pub power_generated: f32,
12107 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12108 pub bus_voltage: f32,
12109 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12110 pub bat_current_setpoint: f32,
12111 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12112 pub runtime: u32,
12113 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12114 pub time_until_maintenance: i32,
12115 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12116 pub generator_speed: u16,
12117 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12118 pub rectifier_temperature: i16,
12119 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12120 pub generator_temperature: i16,
12121}
12122impl GENERATOR_STATUS_DATA {
12123 pub const ENCODED_LEN: usize = 42usize;
12124 pub const DEFAULT: Self = Self {
12125 status: MavGeneratorStatusFlag::DEFAULT,
12126 battery_current: 0.0_f32,
12127 load_current: 0.0_f32,
12128 power_generated: 0.0_f32,
12129 bus_voltage: 0.0_f32,
12130 bat_current_setpoint: 0.0_f32,
12131 runtime: 0_u32,
12132 time_until_maintenance: 0_i32,
12133 generator_speed: 0_u16,
12134 rectifier_temperature: 0_i16,
12135 generator_temperature: 0_i16,
12136 };
12137 #[cfg(feature = "arbitrary")]
12138 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12139 use arbitrary::{Arbitrary, Unstructured};
12140 let mut buf = [0u8; 1024];
12141 rng.fill_bytes(&mut buf);
12142 let mut unstructured = Unstructured::new(&buf);
12143 Self::arbitrary(&mut unstructured).unwrap_or_default()
12144 }
12145}
12146impl Default for GENERATOR_STATUS_DATA {
12147 fn default() -> Self {
12148 Self::DEFAULT.clone()
12149 }
12150}
12151impl MessageData for GENERATOR_STATUS_DATA {
12152 type Message = MavMessage;
12153 const ID: u32 = 373u32;
12154 const NAME: &'static str = "GENERATOR_STATUS";
12155 const EXTRA_CRC: u8 = 117u8;
12156 const ENCODED_LEN: usize = 42usize;
12157 fn deser(
12158 _version: MavlinkVersion,
12159 __input: &[u8],
12160 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12161 let avail_len = __input.len();
12162 let mut payload_buf = [0; Self::ENCODED_LEN];
12163 let mut buf = if avail_len < Self::ENCODED_LEN {
12164 payload_buf[0..avail_len].copy_from_slice(__input);
12165 Bytes::new(&payload_buf)
12166 } else {
12167 Bytes::new(__input)
12168 };
12169 let mut __struct = Self::default();
12170 let tmp = buf.get_u64_le();
12171 __struct.status = MavGeneratorStatusFlag::from_bits(
12172 tmp & MavGeneratorStatusFlag::all().bits(),
12173 )
12174 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12175 flag_type: "MavGeneratorStatusFlag",
12176 value: tmp as u32,
12177 })?;
12178 __struct.battery_current = buf.get_f32_le();
12179 __struct.load_current = buf.get_f32_le();
12180 __struct.power_generated = buf.get_f32_le();
12181 __struct.bus_voltage = buf.get_f32_le();
12182 __struct.bat_current_setpoint = buf.get_f32_le();
12183 __struct.runtime = buf.get_u32_le();
12184 __struct.time_until_maintenance = buf.get_i32_le();
12185 __struct.generator_speed = buf.get_u16_le();
12186 __struct.rectifier_temperature = buf.get_i16_le();
12187 __struct.generator_temperature = buf.get_i16_le();
12188 Ok(__struct)
12189 }
12190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12191 let mut __tmp = BytesMut::new(bytes);
12192 #[allow(clippy::absurd_extreme_comparisons)]
12193 #[allow(unused_comparisons)]
12194 if __tmp.remaining() < Self::ENCODED_LEN {
12195 panic!(
12196 "buffer is too small (need {} bytes, but got {})",
12197 Self::ENCODED_LEN,
12198 __tmp.remaining(),
12199 )
12200 }
12201 __tmp.put_u64_le(self.status.bits());
12202 __tmp.put_f32_le(self.battery_current);
12203 __tmp.put_f32_le(self.load_current);
12204 __tmp.put_f32_le(self.power_generated);
12205 __tmp.put_f32_le(self.bus_voltage);
12206 __tmp.put_f32_le(self.bat_current_setpoint);
12207 __tmp.put_u32_le(self.runtime);
12208 __tmp.put_i32_le(self.time_until_maintenance);
12209 __tmp.put_u16_le(self.generator_speed);
12210 __tmp.put_i16_le(self.rectifier_temperature);
12211 __tmp.put_i16_le(self.generator_temperature);
12212 if matches!(version, MavlinkVersion::V2) {
12213 let len = __tmp.len();
12214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12215 } else {
12216 __tmp.len()
12217 }
12218 }
12219}
12220#[doc = "id: 285"]
12221#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12222#[derive(Debug, Clone, PartialEq)]
12223#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12224#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12225pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12226 #[doc = "Timestamp (time since system boot)."]
12227 pub time_boot_ms: u32,
12228 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12230 pub q: [f32; 4],
12231 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12232 pub angular_velocity_x: f32,
12233 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12234 pub angular_velocity_y: f32,
12235 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12236 pub angular_velocity_z: f32,
12237 #[doc = "Failure flags (0 for no failure)"]
12238 pub failure_flags: GimbalDeviceErrorFlags,
12239 #[doc = "Current gimbal flags set."]
12240 pub flags: GimbalDeviceFlags,
12241 #[doc = "System ID"]
12242 pub target_system: u8,
12243 #[doc = "Component ID"]
12244 pub target_component: u8,
12245 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12246 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12247 pub delta_yaw: f32,
12248 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12249 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12250 pub delta_yaw_velocity: f32,
12251 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12252 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12253 pub gimbal_device_id: u8,
12254}
12255impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12256 pub const ENCODED_LEN: usize = 49usize;
12257 pub const DEFAULT: Self = Self {
12258 time_boot_ms: 0_u32,
12259 q: [0.0_f32; 4usize],
12260 angular_velocity_x: 0.0_f32,
12261 angular_velocity_y: 0.0_f32,
12262 angular_velocity_z: 0.0_f32,
12263 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12264 flags: GimbalDeviceFlags::DEFAULT,
12265 target_system: 0_u8,
12266 target_component: 0_u8,
12267 delta_yaw: 0.0_f32,
12268 delta_yaw_velocity: 0.0_f32,
12269 gimbal_device_id: 0_u8,
12270 };
12271 #[cfg(feature = "arbitrary")]
12272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12273 use arbitrary::{Arbitrary, Unstructured};
12274 let mut buf = [0u8; 1024];
12275 rng.fill_bytes(&mut buf);
12276 let mut unstructured = Unstructured::new(&buf);
12277 Self::arbitrary(&mut unstructured).unwrap_or_default()
12278 }
12279}
12280impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12281 fn default() -> Self {
12282 Self::DEFAULT.clone()
12283 }
12284}
12285impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12286 type Message = MavMessage;
12287 const ID: u32 = 285u32;
12288 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12289 const EXTRA_CRC: u8 = 137u8;
12290 const ENCODED_LEN: usize = 49usize;
12291 fn deser(
12292 _version: MavlinkVersion,
12293 __input: &[u8],
12294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12295 let avail_len = __input.len();
12296 let mut payload_buf = [0; Self::ENCODED_LEN];
12297 let mut buf = if avail_len < Self::ENCODED_LEN {
12298 payload_buf[0..avail_len].copy_from_slice(__input);
12299 Bytes::new(&payload_buf)
12300 } else {
12301 Bytes::new(__input)
12302 };
12303 let mut __struct = Self::default();
12304 __struct.time_boot_ms = buf.get_u32_le();
12305 for v in &mut __struct.q {
12306 let val = buf.get_f32_le();
12307 *v = val;
12308 }
12309 __struct.angular_velocity_x = buf.get_f32_le();
12310 __struct.angular_velocity_y = buf.get_f32_le();
12311 __struct.angular_velocity_z = buf.get_f32_le();
12312 let tmp = buf.get_u32_le();
12313 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12314 tmp & GimbalDeviceErrorFlags::all().bits(),
12315 )
12316 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12317 flag_type: "GimbalDeviceErrorFlags",
12318 value: tmp as u32,
12319 })?;
12320 let tmp = buf.get_u16_le();
12321 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12322 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12323 flag_type: "GimbalDeviceFlags",
12324 value: tmp as u32,
12325 })?;
12326 __struct.target_system = buf.get_u8();
12327 __struct.target_component = buf.get_u8();
12328 __struct.delta_yaw = buf.get_f32_le();
12329 __struct.delta_yaw_velocity = buf.get_f32_le();
12330 __struct.gimbal_device_id = buf.get_u8();
12331 Ok(__struct)
12332 }
12333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12334 let mut __tmp = BytesMut::new(bytes);
12335 #[allow(clippy::absurd_extreme_comparisons)]
12336 #[allow(unused_comparisons)]
12337 if __tmp.remaining() < Self::ENCODED_LEN {
12338 panic!(
12339 "buffer is too small (need {} bytes, but got {})",
12340 Self::ENCODED_LEN,
12341 __tmp.remaining(),
12342 )
12343 }
12344 __tmp.put_u32_le(self.time_boot_ms);
12345 for val in &self.q {
12346 __tmp.put_f32_le(*val);
12347 }
12348 __tmp.put_f32_le(self.angular_velocity_x);
12349 __tmp.put_f32_le(self.angular_velocity_y);
12350 __tmp.put_f32_le(self.angular_velocity_z);
12351 __tmp.put_u32_le(self.failure_flags.bits());
12352 __tmp.put_u16_le(self.flags.bits());
12353 __tmp.put_u8(self.target_system);
12354 __tmp.put_u8(self.target_component);
12355 __tmp.put_f32_le(self.delta_yaw);
12356 __tmp.put_f32_le(self.delta_yaw_velocity);
12357 __tmp.put_u8(self.gimbal_device_id);
12358 if matches!(version, MavlinkVersion::V2) {
12359 let len = __tmp.len();
12360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12361 } else {
12362 __tmp.len()
12363 }
12364 }
12365}
12366#[doc = "id: 283"]
12367#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12368#[derive(Debug, Clone, PartialEq)]
12369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12371pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12372 #[doc = "UID of gimbal hardware (0 if unknown)."]
12373 pub uid: u64,
12374 #[doc = "Timestamp (time since system boot)."]
12375 pub time_boot_ms: u32,
12376 #[doc = "0xff)."]
12377 pub firmware_version: u32,
12378 #[doc = "0xff)."]
12379 pub hardware_version: u32,
12380 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12381 pub roll_min: f32,
12382 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12383 pub roll_max: f32,
12384 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12385 pub pitch_min: f32,
12386 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12387 pub pitch_max: f32,
12388 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12389 pub yaw_min: f32,
12390 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12391 pub yaw_max: f32,
12392 #[doc = "Bitmap of gimbal capability flags."]
12393 pub cap_flags: GimbalDeviceCapFlags,
12394 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12395 pub custom_cap_flags: u16,
12396 #[doc = "Name of the gimbal vendor."]
12397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12398 pub vendor_name: [u8; 32],
12399 #[doc = "Name of the gimbal model."]
12400 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12401 pub model_name: [u8; 32],
12402 #[doc = "Custom name of the gimbal given to it by the user."]
12403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12404 pub custom_name: [u8; 32],
12405 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12406 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12407 pub gimbal_device_id: u8,
12408}
12409impl GIMBAL_DEVICE_INFORMATION_DATA {
12410 pub const ENCODED_LEN: usize = 145usize;
12411 pub const DEFAULT: Self = Self {
12412 uid: 0_u64,
12413 time_boot_ms: 0_u32,
12414 firmware_version: 0_u32,
12415 hardware_version: 0_u32,
12416 roll_min: 0.0_f32,
12417 roll_max: 0.0_f32,
12418 pitch_min: 0.0_f32,
12419 pitch_max: 0.0_f32,
12420 yaw_min: 0.0_f32,
12421 yaw_max: 0.0_f32,
12422 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12423 custom_cap_flags: 0_u16,
12424 vendor_name: [0_u8; 32usize],
12425 model_name: [0_u8; 32usize],
12426 custom_name: [0_u8; 32usize],
12427 gimbal_device_id: 0_u8,
12428 };
12429 #[cfg(feature = "arbitrary")]
12430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12431 use arbitrary::{Arbitrary, Unstructured};
12432 let mut buf = [0u8; 1024];
12433 rng.fill_bytes(&mut buf);
12434 let mut unstructured = Unstructured::new(&buf);
12435 Self::arbitrary(&mut unstructured).unwrap_or_default()
12436 }
12437}
12438impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12439 fn default() -> Self {
12440 Self::DEFAULT.clone()
12441 }
12442}
12443impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12444 type Message = MavMessage;
12445 const ID: u32 = 283u32;
12446 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12447 const EXTRA_CRC: u8 = 74u8;
12448 const ENCODED_LEN: usize = 145usize;
12449 fn deser(
12450 _version: MavlinkVersion,
12451 __input: &[u8],
12452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12453 let avail_len = __input.len();
12454 let mut payload_buf = [0; Self::ENCODED_LEN];
12455 let mut buf = if avail_len < Self::ENCODED_LEN {
12456 payload_buf[0..avail_len].copy_from_slice(__input);
12457 Bytes::new(&payload_buf)
12458 } else {
12459 Bytes::new(__input)
12460 };
12461 let mut __struct = Self::default();
12462 __struct.uid = buf.get_u64_le();
12463 __struct.time_boot_ms = buf.get_u32_le();
12464 __struct.firmware_version = buf.get_u32_le();
12465 __struct.hardware_version = buf.get_u32_le();
12466 __struct.roll_min = buf.get_f32_le();
12467 __struct.roll_max = buf.get_f32_le();
12468 __struct.pitch_min = buf.get_f32_le();
12469 __struct.pitch_max = buf.get_f32_le();
12470 __struct.yaw_min = buf.get_f32_le();
12471 __struct.yaw_max = buf.get_f32_le();
12472 let tmp = buf.get_u16_le();
12473 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12474 tmp & GimbalDeviceCapFlags::all().bits(),
12475 )
12476 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12477 flag_type: "GimbalDeviceCapFlags",
12478 value: tmp as u32,
12479 })?;
12480 __struct.custom_cap_flags = buf.get_u16_le();
12481 for v in &mut __struct.vendor_name {
12482 let val = buf.get_u8();
12483 *v = val;
12484 }
12485 for v in &mut __struct.model_name {
12486 let val = buf.get_u8();
12487 *v = val;
12488 }
12489 for v in &mut __struct.custom_name {
12490 let val = buf.get_u8();
12491 *v = val;
12492 }
12493 __struct.gimbal_device_id = buf.get_u8();
12494 Ok(__struct)
12495 }
12496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12497 let mut __tmp = BytesMut::new(bytes);
12498 #[allow(clippy::absurd_extreme_comparisons)]
12499 #[allow(unused_comparisons)]
12500 if __tmp.remaining() < Self::ENCODED_LEN {
12501 panic!(
12502 "buffer is too small (need {} bytes, but got {})",
12503 Self::ENCODED_LEN,
12504 __tmp.remaining(),
12505 )
12506 }
12507 __tmp.put_u64_le(self.uid);
12508 __tmp.put_u32_le(self.time_boot_ms);
12509 __tmp.put_u32_le(self.firmware_version);
12510 __tmp.put_u32_le(self.hardware_version);
12511 __tmp.put_f32_le(self.roll_min);
12512 __tmp.put_f32_le(self.roll_max);
12513 __tmp.put_f32_le(self.pitch_min);
12514 __tmp.put_f32_le(self.pitch_max);
12515 __tmp.put_f32_le(self.yaw_min);
12516 __tmp.put_f32_le(self.yaw_max);
12517 __tmp.put_u16_le(self.cap_flags.bits());
12518 __tmp.put_u16_le(self.custom_cap_flags);
12519 for val in &self.vendor_name {
12520 __tmp.put_u8(*val);
12521 }
12522 for val in &self.model_name {
12523 __tmp.put_u8(*val);
12524 }
12525 for val in &self.custom_name {
12526 __tmp.put_u8(*val);
12527 }
12528 __tmp.put_u8(self.gimbal_device_id);
12529 if matches!(version, MavlinkVersion::V2) {
12530 let len = __tmp.len();
12531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12532 } else {
12533 __tmp.len()
12534 }
12535 }
12536}
12537#[doc = "id: 284"]
12538#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12539#[derive(Debug, Clone, PartialEq)]
12540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12542pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12543 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12544 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12545 pub q: [f32; 4],
12546 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12547 pub angular_velocity_x: f32,
12548 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12549 pub angular_velocity_y: f32,
12550 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12551 pub angular_velocity_z: f32,
12552 #[doc = "Low level gimbal flags."]
12553 pub flags: GimbalDeviceFlags,
12554 #[doc = "System ID"]
12555 pub target_system: u8,
12556 #[doc = "Component ID"]
12557 pub target_component: u8,
12558}
12559impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12560 pub const ENCODED_LEN: usize = 32usize;
12561 pub const DEFAULT: Self = Self {
12562 q: [0.0_f32; 4usize],
12563 angular_velocity_x: 0.0_f32,
12564 angular_velocity_y: 0.0_f32,
12565 angular_velocity_z: 0.0_f32,
12566 flags: GimbalDeviceFlags::DEFAULT,
12567 target_system: 0_u8,
12568 target_component: 0_u8,
12569 };
12570 #[cfg(feature = "arbitrary")]
12571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12572 use arbitrary::{Arbitrary, Unstructured};
12573 let mut buf = [0u8; 1024];
12574 rng.fill_bytes(&mut buf);
12575 let mut unstructured = Unstructured::new(&buf);
12576 Self::arbitrary(&mut unstructured).unwrap_or_default()
12577 }
12578}
12579impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12580 fn default() -> Self {
12581 Self::DEFAULT.clone()
12582 }
12583}
12584impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12585 type Message = MavMessage;
12586 const ID: u32 = 284u32;
12587 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12588 const EXTRA_CRC: u8 = 99u8;
12589 const ENCODED_LEN: usize = 32usize;
12590 fn deser(
12591 _version: MavlinkVersion,
12592 __input: &[u8],
12593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12594 let avail_len = __input.len();
12595 let mut payload_buf = [0; Self::ENCODED_LEN];
12596 let mut buf = if avail_len < Self::ENCODED_LEN {
12597 payload_buf[0..avail_len].copy_from_slice(__input);
12598 Bytes::new(&payload_buf)
12599 } else {
12600 Bytes::new(__input)
12601 };
12602 let mut __struct = Self::default();
12603 for v in &mut __struct.q {
12604 let val = buf.get_f32_le();
12605 *v = val;
12606 }
12607 __struct.angular_velocity_x = buf.get_f32_le();
12608 __struct.angular_velocity_y = buf.get_f32_le();
12609 __struct.angular_velocity_z = buf.get_f32_le();
12610 let tmp = buf.get_u16_le();
12611 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12612 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12613 flag_type: "GimbalDeviceFlags",
12614 value: tmp as u32,
12615 })?;
12616 __struct.target_system = buf.get_u8();
12617 __struct.target_component = buf.get_u8();
12618 Ok(__struct)
12619 }
12620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12621 let mut __tmp = BytesMut::new(bytes);
12622 #[allow(clippy::absurd_extreme_comparisons)]
12623 #[allow(unused_comparisons)]
12624 if __tmp.remaining() < Self::ENCODED_LEN {
12625 panic!(
12626 "buffer is too small (need {} bytes, but got {})",
12627 Self::ENCODED_LEN,
12628 __tmp.remaining(),
12629 )
12630 }
12631 for val in &self.q {
12632 __tmp.put_f32_le(*val);
12633 }
12634 __tmp.put_f32_le(self.angular_velocity_x);
12635 __tmp.put_f32_le(self.angular_velocity_y);
12636 __tmp.put_f32_le(self.angular_velocity_z);
12637 __tmp.put_u16_le(self.flags.bits());
12638 __tmp.put_u8(self.target_system);
12639 __tmp.put_u8(self.target_component);
12640 if matches!(version, MavlinkVersion::V2) {
12641 let len = __tmp.len();
12642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12643 } else {
12644 __tmp.len()
12645 }
12646 }
12647}
12648#[doc = "id: 280"]
12649#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12650#[derive(Debug, Clone, PartialEq)]
12651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12653pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12654 #[doc = "Timestamp (time since system boot)."]
12655 pub time_boot_ms: u32,
12656 #[doc = "Bitmap of gimbal capability flags."]
12657 pub cap_flags: GimbalManagerCapFlags,
12658 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12659 pub roll_min: f32,
12660 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12661 pub roll_max: f32,
12662 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12663 pub pitch_min: f32,
12664 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12665 pub pitch_max: f32,
12666 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12667 pub yaw_min: f32,
12668 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12669 pub yaw_max: f32,
12670 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12671 pub gimbal_device_id: u8,
12672}
12673impl GIMBAL_MANAGER_INFORMATION_DATA {
12674 pub const ENCODED_LEN: usize = 33usize;
12675 pub const DEFAULT: Self = Self {
12676 time_boot_ms: 0_u32,
12677 cap_flags: GimbalManagerCapFlags::DEFAULT,
12678 roll_min: 0.0_f32,
12679 roll_max: 0.0_f32,
12680 pitch_min: 0.0_f32,
12681 pitch_max: 0.0_f32,
12682 yaw_min: 0.0_f32,
12683 yaw_max: 0.0_f32,
12684 gimbal_device_id: 0_u8,
12685 };
12686 #[cfg(feature = "arbitrary")]
12687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12688 use arbitrary::{Arbitrary, Unstructured};
12689 let mut buf = [0u8; 1024];
12690 rng.fill_bytes(&mut buf);
12691 let mut unstructured = Unstructured::new(&buf);
12692 Self::arbitrary(&mut unstructured).unwrap_or_default()
12693 }
12694}
12695impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12696 fn default() -> Self {
12697 Self::DEFAULT.clone()
12698 }
12699}
12700impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12701 type Message = MavMessage;
12702 const ID: u32 = 280u32;
12703 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12704 const EXTRA_CRC: u8 = 70u8;
12705 const ENCODED_LEN: usize = 33usize;
12706 fn deser(
12707 _version: MavlinkVersion,
12708 __input: &[u8],
12709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12710 let avail_len = __input.len();
12711 let mut payload_buf = [0; Self::ENCODED_LEN];
12712 let mut buf = if avail_len < Self::ENCODED_LEN {
12713 payload_buf[0..avail_len].copy_from_slice(__input);
12714 Bytes::new(&payload_buf)
12715 } else {
12716 Bytes::new(__input)
12717 };
12718 let mut __struct = Self::default();
12719 __struct.time_boot_ms = buf.get_u32_le();
12720 let tmp = buf.get_u32_le();
12721 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12722 tmp & GimbalManagerCapFlags::all().bits(),
12723 )
12724 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12725 flag_type: "GimbalManagerCapFlags",
12726 value: tmp as u32,
12727 })?;
12728 __struct.roll_min = buf.get_f32_le();
12729 __struct.roll_max = buf.get_f32_le();
12730 __struct.pitch_min = buf.get_f32_le();
12731 __struct.pitch_max = buf.get_f32_le();
12732 __struct.yaw_min = buf.get_f32_le();
12733 __struct.yaw_max = buf.get_f32_le();
12734 __struct.gimbal_device_id = buf.get_u8();
12735 Ok(__struct)
12736 }
12737 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12738 let mut __tmp = BytesMut::new(bytes);
12739 #[allow(clippy::absurd_extreme_comparisons)]
12740 #[allow(unused_comparisons)]
12741 if __tmp.remaining() < Self::ENCODED_LEN {
12742 panic!(
12743 "buffer is too small (need {} bytes, but got {})",
12744 Self::ENCODED_LEN,
12745 __tmp.remaining(),
12746 )
12747 }
12748 __tmp.put_u32_le(self.time_boot_ms);
12749 __tmp.put_u32_le(self.cap_flags.bits());
12750 __tmp.put_f32_le(self.roll_min);
12751 __tmp.put_f32_le(self.roll_max);
12752 __tmp.put_f32_le(self.pitch_min);
12753 __tmp.put_f32_le(self.pitch_max);
12754 __tmp.put_f32_le(self.yaw_min);
12755 __tmp.put_f32_le(self.yaw_max);
12756 __tmp.put_u8(self.gimbal_device_id);
12757 if matches!(version, MavlinkVersion::V2) {
12758 let len = __tmp.len();
12759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12760 } else {
12761 __tmp.len()
12762 }
12763 }
12764}
12765#[doc = "id: 282"]
12766#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12767#[derive(Debug, Clone, PartialEq)]
12768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12770pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12771 #[doc = "High level gimbal manager flags to use."]
12772 pub flags: GimbalManagerFlags,
12773 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12774 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12775 pub q: [f32; 4],
12776 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12777 pub angular_velocity_x: f32,
12778 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12779 pub angular_velocity_y: f32,
12780 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12781 pub angular_velocity_z: f32,
12782 #[doc = "System ID"]
12783 pub target_system: u8,
12784 #[doc = "Component ID"]
12785 pub target_component: u8,
12786 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12787 pub gimbal_device_id: u8,
12788}
12789impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12790 pub const ENCODED_LEN: usize = 35usize;
12791 pub const DEFAULT: Self = Self {
12792 flags: GimbalManagerFlags::DEFAULT,
12793 q: [0.0_f32; 4usize],
12794 angular_velocity_x: 0.0_f32,
12795 angular_velocity_y: 0.0_f32,
12796 angular_velocity_z: 0.0_f32,
12797 target_system: 0_u8,
12798 target_component: 0_u8,
12799 gimbal_device_id: 0_u8,
12800 };
12801 #[cfg(feature = "arbitrary")]
12802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12803 use arbitrary::{Arbitrary, Unstructured};
12804 let mut buf = [0u8; 1024];
12805 rng.fill_bytes(&mut buf);
12806 let mut unstructured = Unstructured::new(&buf);
12807 Self::arbitrary(&mut unstructured).unwrap_or_default()
12808 }
12809}
12810impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12811 fn default() -> Self {
12812 Self::DEFAULT.clone()
12813 }
12814}
12815impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12816 type Message = MavMessage;
12817 const ID: u32 = 282u32;
12818 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12819 const EXTRA_CRC: u8 = 123u8;
12820 const ENCODED_LEN: usize = 35usize;
12821 fn deser(
12822 _version: MavlinkVersion,
12823 __input: &[u8],
12824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12825 let avail_len = __input.len();
12826 let mut payload_buf = [0; Self::ENCODED_LEN];
12827 let mut buf = if avail_len < Self::ENCODED_LEN {
12828 payload_buf[0..avail_len].copy_from_slice(__input);
12829 Bytes::new(&payload_buf)
12830 } else {
12831 Bytes::new(__input)
12832 };
12833 let mut __struct = Self::default();
12834 let tmp = buf.get_u32_le();
12835 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12836 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12837 flag_type: "GimbalManagerFlags",
12838 value: tmp as u32,
12839 })?;
12840 for v in &mut __struct.q {
12841 let val = buf.get_f32_le();
12842 *v = val;
12843 }
12844 __struct.angular_velocity_x = buf.get_f32_le();
12845 __struct.angular_velocity_y = buf.get_f32_le();
12846 __struct.angular_velocity_z = buf.get_f32_le();
12847 __struct.target_system = buf.get_u8();
12848 __struct.target_component = buf.get_u8();
12849 __struct.gimbal_device_id = buf.get_u8();
12850 Ok(__struct)
12851 }
12852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12853 let mut __tmp = BytesMut::new(bytes);
12854 #[allow(clippy::absurd_extreme_comparisons)]
12855 #[allow(unused_comparisons)]
12856 if __tmp.remaining() < Self::ENCODED_LEN {
12857 panic!(
12858 "buffer is too small (need {} bytes, but got {})",
12859 Self::ENCODED_LEN,
12860 __tmp.remaining(),
12861 )
12862 }
12863 __tmp.put_u32_le(self.flags.bits());
12864 for val in &self.q {
12865 __tmp.put_f32_le(*val);
12866 }
12867 __tmp.put_f32_le(self.angular_velocity_x);
12868 __tmp.put_f32_le(self.angular_velocity_y);
12869 __tmp.put_f32_le(self.angular_velocity_z);
12870 __tmp.put_u8(self.target_system);
12871 __tmp.put_u8(self.target_component);
12872 __tmp.put_u8(self.gimbal_device_id);
12873 if matches!(version, MavlinkVersion::V2) {
12874 let len = __tmp.len();
12875 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12876 } else {
12877 __tmp.len()
12878 }
12879 }
12880}
12881#[doc = "id: 288"]
12882#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12883#[derive(Debug, Clone, PartialEq)]
12884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12886pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12887 #[doc = "High level gimbal manager flags."]
12888 pub flags: GimbalManagerFlags,
12889 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12890 pub pitch: f32,
12891 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12892 pub yaw: f32,
12893 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12894 pub pitch_rate: f32,
12895 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12896 pub yaw_rate: f32,
12897 #[doc = "System ID"]
12898 pub target_system: u8,
12899 #[doc = "Component ID"]
12900 pub target_component: u8,
12901 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12902 pub gimbal_device_id: u8,
12903}
12904impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12905 pub const ENCODED_LEN: usize = 23usize;
12906 pub const DEFAULT: Self = Self {
12907 flags: GimbalManagerFlags::DEFAULT,
12908 pitch: 0.0_f32,
12909 yaw: 0.0_f32,
12910 pitch_rate: 0.0_f32,
12911 yaw_rate: 0.0_f32,
12912 target_system: 0_u8,
12913 target_component: 0_u8,
12914 gimbal_device_id: 0_u8,
12915 };
12916 #[cfg(feature = "arbitrary")]
12917 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12918 use arbitrary::{Arbitrary, Unstructured};
12919 let mut buf = [0u8; 1024];
12920 rng.fill_bytes(&mut buf);
12921 let mut unstructured = Unstructured::new(&buf);
12922 Self::arbitrary(&mut unstructured).unwrap_or_default()
12923 }
12924}
12925impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12926 fn default() -> Self {
12927 Self::DEFAULT.clone()
12928 }
12929}
12930impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12931 type Message = MavMessage;
12932 const ID: u32 = 288u32;
12933 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12934 const EXTRA_CRC: u8 = 20u8;
12935 const ENCODED_LEN: usize = 23usize;
12936 fn deser(
12937 _version: MavlinkVersion,
12938 __input: &[u8],
12939 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12940 let avail_len = __input.len();
12941 let mut payload_buf = [0; Self::ENCODED_LEN];
12942 let mut buf = if avail_len < Self::ENCODED_LEN {
12943 payload_buf[0..avail_len].copy_from_slice(__input);
12944 Bytes::new(&payload_buf)
12945 } else {
12946 Bytes::new(__input)
12947 };
12948 let mut __struct = Self::default();
12949 let tmp = buf.get_u32_le();
12950 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12951 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12952 flag_type: "GimbalManagerFlags",
12953 value: tmp as u32,
12954 })?;
12955 __struct.pitch = buf.get_f32_le();
12956 __struct.yaw = buf.get_f32_le();
12957 __struct.pitch_rate = buf.get_f32_le();
12958 __struct.yaw_rate = buf.get_f32_le();
12959 __struct.target_system = buf.get_u8();
12960 __struct.target_component = buf.get_u8();
12961 __struct.gimbal_device_id = buf.get_u8();
12962 Ok(__struct)
12963 }
12964 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12965 let mut __tmp = BytesMut::new(bytes);
12966 #[allow(clippy::absurd_extreme_comparisons)]
12967 #[allow(unused_comparisons)]
12968 if __tmp.remaining() < Self::ENCODED_LEN {
12969 panic!(
12970 "buffer is too small (need {} bytes, but got {})",
12971 Self::ENCODED_LEN,
12972 __tmp.remaining(),
12973 )
12974 }
12975 __tmp.put_u32_le(self.flags.bits());
12976 __tmp.put_f32_le(self.pitch);
12977 __tmp.put_f32_le(self.yaw);
12978 __tmp.put_f32_le(self.pitch_rate);
12979 __tmp.put_f32_le(self.yaw_rate);
12980 __tmp.put_u8(self.target_system);
12981 __tmp.put_u8(self.target_component);
12982 __tmp.put_u8(self.gimbal_device_id);
12983 if matches!(version, MavlinkVersion::V2) {
12984 let len = __tmp.len();
12985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12986 } else {
12987 __tmp.len()
12988 }
12989 }
12990}
12991#[doc = "id: 287"]
12992#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12993#[derive(Debug, Clone, PartialEq)]
12994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12996pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12997 #[doc = "High level gimbal manager flags to use."]
12998 pub flags: GimbalManagerFlags,
12999 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13000 pub pitch: f32,
13001 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13002 pub yaw: f32,
13003 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13004 pub pitch_rate: f32,
13005 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13006 pub yaw_rate: f32,
13007 #[doc = "System ID"]
13008 pub target_system: u8,
13009 #[doc = "Component ID"]
13010 pub target_component: u8,
13011 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13012 pub gimbal_device_id: u8,
13013}
13014impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13015 pub const ENCODED_LEN: usize = 23usize;
13016 pub const DEFAULT: Self = Self {
13017 flags: GimbalManagerFlags::DEFAULT,
13018 pitch: 0.0_f32,
13019 yaw: 0.0_f32,
13020 pitch_rate: 0.0_f32,
13021 yaw_rate: 0.0_f32,
13022 target_system: 0_u8,
13023 target_component: 0_u8,
13024 gimbal_device_id: 0_u8,
13025 };
13026 #[cfg(feature = "arbitrary")]
13027 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13028 use arbitrary::{Arbitrary, Unstructured};
13029 let mut buf = [0u8; 1024];
13030 rng.fill_bytes(&mut buf);
13031 let mut unstructured = Unstructured::new(&buf);
13032 Self::arbitrary(&mut unstructured).unwrap_or_default()
13033 }
13034}
13035impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13036 fn default() -> Self {
13037 Self::DEFAULT.clone()
13038 }
13039}
13040impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13041 type Message = MavMessage;
13042 const ID: u32 = 287u32;
13043 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13044 const EXTRA_CRC: u8 = 1u8;
13045 const ENCODED_LEN: usize = 23usize;
13046 fn deser(
13047 _version: MavlinkVersion,
13048 __input: &[u8],
13049 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13050 let avail_len = __input.len();
13051 let mut payload_buf = [0; Self::ENCODED_LEN];
13052 let mut buf = if avail_len < Self::ENCODED_LEN {
13053 payload_buf[0..avail_len].copy_from_slice(__input);
13054 Bytes::new(&payload_buf)
13055 } else {
13056 Bytes::new(__input)
13057 };
13058 let mut __struct = Self::default();
13059 let tmp = buf.get_u32_le();
13060 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13061 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13062 flag_type: "GimbalManagerFlags",
13063 value: tmp as u32,
13064 })?;
13065 __struct.pitch = buf.get_f32_le();
13066 __struct.yaw = buf.get_f32_le();
13067 __struct.pitch_rate = buf.get_f32_le();
13068 __struct.yaw_rate = buf.get_f32_le();
13069 __struct.target_system = buf.get_u8();
13070 __struct.target_component = buf.get_u8();
13071 __struct.gimbal_device_id = buf.get_u8();
13072 Ok(__struct)
13073 }
13074 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13075 let mut __tmp = BytesMut::new(bytes);
13076 #[allow(clippy::absurd_extreme_comparisons)]
13077 #[allow(unused_comparisons)]
13078 if __tmp.remaining() < Self::ENCODED_LEN {
13079 panic!(
13080 "buffer is too small (need {} bytes, but got {})",
13081 Self::ENCODED_LEN,
13082 __tmp.remaining(),
13083 )
13084 }
13085 __tmp.put_u32_le(self.flags.bits());
13086 __tmp.put_f32_le(self.pitch);
13087 __tmp.put_f32_le(self.yaw);
13088 __tmp.put_f32_le(self.pitch_rate);
13089 __tmp.put_f32_le(self.yaw_rate);
13090 __tmp.put_u8(self.target_system);
13091 __tmp.put_u8(self.target_component);
13092 __tmp.put_u8(self.gimbal_device_id);
13093 if matches!(version, MavlinkVersion::V2) {
13094 let len = __tmp.len();
13095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13096 } else {
13097 __tmp.len()
13098 }
13099 }
13100}
13101#[doc = "id: 281"]
13102#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13103#[derive(Debug, Clone, PartialEq)]
13104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13106pub struct GIMBAL_MANAGER_STATUS_DATA {
13107 #[doc = "Timestamp (time since system boot)."]
13108 pub time_boot_ms: u32,
13109 #[doc = "High level gimbal manager flags currently applied."]
13110 pub flags: GimbalManagerFlags,
13111 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13112 pub gimbal_device_id: u8,
13113 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13114 pub primary_control_sysid: u8,
13115 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13116 pub primary_control_compid: u8,
13117 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13118 pub secondary_control_sysid: u8,
13119 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13120 pub secondary_control_compid: u8,
13121}
13122impl GIMBAL_MANAGER_STATUS_DATA {
13123 pub const ENCODED_LEN: usize = 13usize;
13124 pub const DEFAULT: Self = Self {
13125 time_boot_ms: 0_u32,
13126 flags: GimbalManagerFlags::DEFAULT,
13127 gimbal_device_id: 0_u8,
13128 primary_control_sysid: 0_u8,
13129 primary_control_compid: 0_u8,
13130 secondary_control_sysid: 0_u8,
13131 secondary_control_compid: 0_u8,
13132 };
13133 #[cfg(feature = "arbitrary")]
13134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13135 use arbitrary::{Arbitrary, Unstructured};
13136 let mut buf = [0u8; 1024];
13137 rng.fill_bytes(&mut buf);
13138 let mut unstructured = Unstructured::new(&buf);
13139 Self::arbitrary(&mut unstructured).unwrap_or_default()
13140 }
13141}
13142impl Default for GIMBAL_MANAGER_STATUS_DATA {
13143 fn default() -> Self {
13144 Self::DEFAULT.clone()
13145 }
13146}
13147impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13148 type Message = MavMessage;
13149 const ID: u32 = 281u32;
13150 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13151 const EXTRA_CRC: u8 = 48u8;
13152 const ENCODED_LEN: usize = 13usize;
13153 fn deser(
13154 _version: MavlinkVersion,
13155 __input: &[u8],
13156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13157 let avail_len = __input.len();
13158 let mut payload_buf = [0; Self::ENCODED_LEN];
13159 let mut buf = if avail_len < Self::ENCODED_LEN {
13160 payload_buf[0..avail_len].copy_from_slice(__input);
13161 Bytes::new(&payload_buf)
13162 } else {
13163 Bytes::new(__input)
13164 };
13165 let mut __struct = Self::default();
13166 __struct.time_boot_ms = buf.get_u32_le();
13167 let tmp = buf.get_u32_le();
13168 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13169 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13170 flag_type: "GimbalManagerFlags",
13171 value: tmp as u32,
13172 })?;
13173 __struct.gimbal_device_id = buf.get_u8();
13174 __struct.primary_control_sysid = buf.get_u8();
13175 __struct.primary_control_compid = buf.get_u8();
13176 __struct.secondary_control_sysid = buf.get_u8();
13177 __struct.secondary_control_compid = buf.get_u8();
13178 Ok(__struct)
13179 }
13180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13181 let mut __tmp = BytesMut::new(bytes);
13182 #[allow(clippy::absurd_extreme_comparisons)]
13183 #[allow(unused_comparisons)]
13184 if __tmp.remaining() < Self::ENCODED_LEN {
13185 panic!(
13186 "buffer is too small (need {} bytes, but got {})",
13187 Self::ENCODED_LEN,
13188 __tmp.remaining(),
13189 )
13190 }
13191 __tmp.put_u32_le(self.time_boot_ms);
13192 __tmp.put_u32_le(self.flags.bits());
13193 __tmp.put_u8(self.gimbal_device_id);
13194 __tmp.put_u8(self.primary_control_sysid);
13195 __tmp.put_u8(self.primary_control_compid);
13196 __tmp.put_u8(self.secondary_control_sysid);
13197 __tmp.put_u8(self.secondary_control_compid);
13198 if matches!(version, MavlinkVersion::V2) {
13199 let len = __tmp.len();
13200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13201 } else {
13202 __tmp.len()
13203 }
13204 }
13205}
13206#[doc = "id: 33"]
13207#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13208#[derive(Debug, Clone, PartialEq)]
13209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13211pub struct GLOBAL_POSITION_INT_DATA {
13212 #[doc = "Timestamp (time since system boot)."]
13213 pub time_boot_ms: u32,
13214 #[doc = "Latitude, expressed"]
13215 pub lat: i32,
13216 #[doc = "Longitude, expressed"]
13217 pub lon: i32,
13218 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13219 pub alt: i32,
13220 #[doc = "Altitude above home"]
13221 pub relative_alt: i32,
13222 #[doc = "Ground X Speed (Latitude, positive north)"]
13223 pub vx: i16,
13224 #[doc = "Ground Y Speed (Longitude, positive east)"]
13225 pub vy: i16,
13226 #[doc = "Ground Z Speed (Altitude, positive down)"]
13227 pub vz: i16,
13228 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13229 pub hdg: u16,
13230}
13231impl GLOBAL_POSITION_INT_DATA {
13232 pub const ENCODED_LEN: usize = 28usize;
13233 pub const DEFAULT: Self = Self {
13234 time_boot_ms: 0_u32,
13235 lat: 0_i32,
13236 lon: 0_i32,
13237 alt: 0_i32,
13238 relative_alt: 0_i32,
13239 vx: 0_i16,
13240 vy: 0_i16,
13241 vz: 0_i16,
13242 hdg: 0_u16,
13243 };
13244 #[cfg(feature = "arbitrary")]
13245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13246 use arbitrary::{Arbitrary, Unstructured};
13247 let mut buf = [0u8; 1024];
13248 rng.fill_bytes(&mut buf);
13249 let mut unstructured = Unstructured::new(&buf);
13250 Self::arbitrary(&mut unstructured).unwrap_or_default()
13251 }
13252}
13253impl Default for GLOBAL_POSITION_INT_DATA {
13254 fn default() -> Self {
13255 Self::DEFAULT.clone()
13256 }
13257}
13258impl MessageData for GLOBAL_POSITION_INT_DATA {
13259 type Message = MavMessage;
13260 const ID: u32 = 33u32;
13261 const NAME: &'static str = "GLOBAL_POSITION_INT";
13262 const EXTRA_CRC: u8 = 104u8;
13263 const ENCODED_LEN: usize = 28usize;
13264 fn deser(
13265 _version: MavlinkVersion,
13266 __input: &[u8],
13267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13268 let avail_len = __input.len();
13269 let mut payload_buf = [0; Self::ENCODED_LEN];
13270 let mut buf = if avail_len < Self::ENCODED_LEN {
13271 payload_buf[0..avail_len].copy_from_slice(__input);
13272 Bytes::new(&payload_buf)
13273 } else {
13274 Bytes::new(__input)
13275 };
13276 let mut __struct = Self::default();
13277 __struct.time_boot_ms = buf.get_u32_le();
13278 __struct.lat = buf.get_i32_le();
13279 __struct.lon = buf.get_i32_le();
13280 __struct.alt = buf.get_i32_le();
13281 __struct.relative_alt = buf.get_i32_le();
13282 __struct.vx = buf.get_i16_le();
13283 __struct.vy = buf.get_i16_le();
13284 __struct.vz = buf.get_i16_le();
13285 __struct.hdg = buf.get_u16_le();
13286 Ok(__struct)
13287 }
13288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13289 let mut __tmp = BytesMut::new(bytes);
13290 #[allow(clippy::absurd_extreme_comparisons)]
13291 #[allow(unused_comparisons)]
13292 if __tmp.remaining() < Self::ENCODED_LEN {
13293 panic!(
13294 "buffer is too small (need {} bytes, but got {})",
13295 Self::ENCODED_LEN,
13296 __tmp.remaining(),
13297 )
13298 }
13299 __tmp.put_u32_le(self.time_boot_ms);
13300 __tmp.put_i32_le(self.lat);
13301 __tmp.put_i32_le(self.lon);
13302 __tmp.put_i32_le(self.alt);
13303 __tmp.put_i32_le(self.relative_alt);
13304 __tmp.put_i16_le(self.vx);
13305 __tmp.put_i16_le(self.vy);
13306 __tmp.put_i16_le(self.vz);
13307 __tmp.put_u16_le(self.hdg);
13308 if matches!(version, MavlinkVersion::V2) {
13309 let len = __tmp.len();
13310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13311 } else {
13312 __tmp.len()
13313 }
13314 }
13315}
13316#[doc = "id: 63"]
13317#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13318#[derive(Debug, Clone, PartialEq)]
13319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13321pub struct GLOBAL_POSITION_INT_COV_DATA {
13322 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13323 pub time_usec: u64,
13324 #[doc = "Latitude"]
13325 pub lat: i32,
13326 #[doc = "Longitude"]
13327 pub lon: i32,
13328 #[doc = "Altitude in meters above MSL"]
13329 pub alt: i32,
13330 #[doc = "Altitude above ground"]
13331 pub relative_alt: i32,
13332 #[doc = "Ground X Speed (Latitude)"]
13333 pub vx: f32,
13334 #[doc = "Ground Y Speed (Longitude)"]
13335 pub vy: f32,
13336 #[doc = "Ground Z Speed (Altitude)"]
13337 pub vz: f32,
13338 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13340 pub covariance: [f32; 36],
13341 #[doc = "Class id of the estimator this estimate originated from."]
13342 pub estimator_type: MavEstimatorType,
13343}
13344impl GLOBAL_POSITION_INT_COV_DATA {
13345 pub const ENCODED_LEN: usize = 181usize;
13346 pub const DEFAULT: Self = Self {
13347 time_usec: 0_u64,
13348 lat: 0_i32,
13349 lon: 0_i32,
13350 alt: 0_i32,
13351 relative_alt: 0_i32,
13352 vx: 0.0_f32,
13353 vy: 0.0_f32,
13354 vz: 0.0_f32,
13355 covariance: [0.0_f32; 36usize],
13356 estimator_type: MavEstimatorType::DEFAULT,
13357 };
13358 #[cfg(feature = "arbitrary")]
13359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13360 use arbitrary::{Arbitrary, Unstructured};
13361 let mut buf = [0u8; 1024];
13362 rng.fill_bytes(&mut buf);
13363 let mut unstructured = Unstructured::new(&buf);
13364 Self::arbitrary(&mut unstructured).unwrap_or_default()
13365 }
13366}
13367impl Default for GLOBAL_POSITION_INT_COV_DATA {
13368 fn default() -> Self {
13369 Self::DEFAULT.clone()
13370 }
13371}
13372impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13373 type Message = MavMessage;
13374 const ID: u32 = 63u32;
13375 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13376 const EXTRA_CRC: u8 = 119u8;
13377 const ENCODED_LEN: usize = 181usize;
13378 fn deser(
13379 _version: MavlinkVersion,
13380 __input: &[u8],
13381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13382 let avail_len = __input.len();
13383 let mut payload_buf = [0; Self::ENCODED_LEN];
13384 let mut buf = if avail_len < Self::ENCODED_LEN {
13385 payload_buf[0..avail_len].copy_from_slice(__input);
13386 Bytes::new(&payload_buf)
13387 } else {
13388 Bytes::new(__input)
13389 };
13390 let mut __struct = Self::default();
13391 __struct.time_usec = buf.get_u64_le();
13392 __struct.lat = buf.get_i32_le();
13393 __struct.lon = buf.get_i32_le();
13394 __struct.alt = buf.get_i32_le();
13395 __struct.relative_alt = buf.get_i32_le();
13396 __struct.vx = buf.get_f32_le();
13397 __struct.vy = buf.get_f32_le();
13398 __struct.vz = buf.get_f32_le();
13399 for v in &mut __struct.covariance {
13400 let val = buf.get_f32_le();
13401 *v = val;
13402 }
13403 let tmp = buf.get_u8();
13404 __struct.estimator_type =
13405 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13406 enum_type: "MavEstimatorType",
13407 value: tmp as u32,
13408 })?;
13409 Ok(__struct)
13410 }
13411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13412 let mut __tmp = BytesMut::new(bytes);
13413 #[allow(clippy::absurd_extreme_comparisons)]
13414 #[allow(unused_comparisons)]
13415 if __tmp.remaining() < Self::ENCODED_LEN {
13416 panic!(
13417 "buffer is too small (need {} bytes, but got {})",
13418 Self::ENCODED_LEN,
13419 __tmp.remaining(),
13420 )
13421 }
13422 __tmp.put_u64_le(self.time_usec);
13423 __tmp.put_i32_le(self.lat);
13424 __tmp.put_i32_le(self.lon);
13425 __tmp.put_i32_le(self.alt);
13426 __tmp.put_i32_le(self.relative_alt);
13427 __tmp.put_f32_le(self.vx);
13428 __tmp.put_f32_le(self.vy);
13429 __tmp.put_f32_le(self.vz);
13430 for val in &self.covariance {
13431 __tmp.put_f32_le(*val);
13432 }
13433 __tmp.put_u8(self.estimator_type as u8);
13434 if matches!(version, MavlinkVersion::V2) {
13435 let len = __tmp.len();
13436 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13437 } else {
13438 __tmp.len()
13439 }
13440 }
13441}
13442#[doc = "id: 101"]
13443#[doc = "Global position/attitude estimate from a vision source."]
13444#[derive(Debug, Clone, PartialEq)]
13445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13447pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13448 #[doc = "Timestamp (UNIX time or since system boot)"]
13449 pub usec: u64,
13450 #[doc = "Global X position"]
13451 pub x: f32,
13452 #[doc = "Global Y position"]
13453 pub y: f32,
13454 #[doc = "Global Z position"]
13455 pub z: f32,
13456 #[doc = "Roll angle"]
13457 pub roll: f32,
13458 #[doc = "Pitch angle"]
13459 pub pitch: f32,
13460 #[doc = "Yaw angle"]
13461 pub yaw: f32,
13462 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13463 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13464 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13465 pub covariance: [f32; 21],
13466 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13468 pub reset_counter: u8,
13469}
13470impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13471 pub const ENCODED_LEN: usize = 117usize;
13472 pub const DEFAULT: Self = Self {
13473 usec: 0_u64,
13474 x: 0.0_f32,
13475 y: 0.0_f32,
13476 z: 0.0_f32,
13477 roll: 0.0_f32,
13478 pitch: 0.0_f32,
13479 yaw: 0.0_f32,
13480 covariance: [0.0_f32; 21usize],
13481 reset_counter: 0_u8,
13482 };
13483 #[cfg(feature = "arbitrary")]
13484 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13485 use arbitrary::{Arbitrary, Unstructured};
13486 let mut buf = [0u8; 1024];
13487 rng.fill_bytes(&mut buf);
13488 let mut unstructured = Unstructured::new(&buf);
13489 Self::arbitrary(&mut unstructured).unwrap_or_default()
13490 }
13491}
13492impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13493 fn default() -> Self {
13494 Self::DEFAULT.clone()
13495 }
13496}
13497impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13498 type Message = MavMessage;
13499 const ID: u32 = 101u32;
13500 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13501 const EXTRA_CRC: u8 = 102u8;
13502 const ENCODED_LEN: usize = 117usize;
13503 fn deser(
13504 _version: MavlinkVersion,
13505 __input: &[u8],
13506 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13507 let avail_len = __input.len();
13508 let mut payload_buf = [0; Self::ENCODED_LEN];
13509 let mut buf = if avail_len < Self::ENCODED_LEN {
13510 payload_buf[0..avail_len].copy_from_slice(__input);
13511 Bytes::new(&payload_buf)
13512 } else {
13513 Bytes::new(__input)
13514 };
13515 let mut __struct = Self::default();
13516 __struct.usec = buf.get_u64_le();
13517 __struct.x = buf.get_f32_le();
13518 __struct.y = buf.get_f32_le();
13519 __struct.z = buf.get_f32_le();
13520 __struct.roll = buf.get_f32_le();
13521 __struct.pitch = buf.get_f32_le();
13522 __struct.yaw = buf.get_f32_le();
13523 for v in &mut __struct.covariance {
13524 let val = buf.get_f32_le();
13525 *v = val;
13526 }
13527 __struct.reset_counter = buf.get_u8();
13528 Ok(__struct)
13529 }
13530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13531 let mut __tmp = BytesMut::new(bytes);
13532 #[allow(clippy::absurd_extreme_comparisons)]
13533 #[allow(unused_comparisons)]
13534 if __tmp.remaining() < Self::ENCODED_LEN {
13535 panic!(
13536 "buffer is too small (need {} bytes, but got {})",
13537 Self::ENCODED_LEN,
13538 __tmp.remaining(),
13539 )
13540 }
13541 __tmp.put_u64_le(self.usec);
13542 __tmp.put_f32_le(self.x);
13543 __tmp.put_f32_le(self.y);
13544 __tmp.put_f32_le(self.z);
13545 __tmp.put_f32_le(self.roll);
13546 __tmp.put_f32_le(self.pitch);
13547 __tmp.put_f32_le(self.yaw);
13548 for val in &self.covariance {
13549 __tmp.put_f32_le(*val);
13550 }
13551 __tmp.put_u8(self.reset_counter);
13552 if matches!(version, MavlinkVersion::V2) {
13553 let len = __tmp.len();
13554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13555 } else {
13556 __tmp.len()
13557 }
13558 }
13559}
13560#[doc = "id: 124"]
13561#[doc = "Second GPS data."]
13562#[derive(Debug, Clone, PartialEq)]
13563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13565pub struct GPS2_RAW_DATA {
13566 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13567 pub time_usec: u64,
13568 #[doc = "Latitude (WGS84)"]
13569 pub lat: i32,
13570 #[doc = "Longitude (WGS84)"]
13571 pub lon: i32,
13572 #[doc = "Altitude (MSL). Positive for up."]
13573 pub alt: i32,
13574 #[doc = "Age of DGPS info"]
13575 pub dgps_age: u32,
13576 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13577 pub eph: u16,
13578 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13579 pub epv: u16,
13580 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13581 pub vel: u16,
13582 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13583 pub cog: u16,
13584 #[doc = "GPS fix type."]
13585 pub fix_type: GpsFixType,
13586 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13587 pub satellites_visible: u8,
13588 #[doc = "Number of DGPS satellites"]
13589 pub dgps_numch: u8,
13590 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13592 pub yaw: u16,
13593 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13595 pub alt_ellipsoid: i32,
13596 #[doc = "Position uncertainty."]
13597 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13598 pub h_acc: u32,
13599 #[doc = "Altitude uncertainty."]
13600 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13601 pub v_acc: u32,
13602 #[doc = "Speed uncertainty."]
13603 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13604 pub vel_acc: u32,
13605 #[doc = "Heading / track uncertainty"]
13606 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13607 pub hdg_acc: u32,
13608}
13609impl GPS2_RAW_DATA {
13610 pub const ENCODED_LEN: usize = 57usize;
13611 pub const DEFAULT: Self = Self {
13612 time_usec: 0_u64,
13613 lat: 0_i32,
13614 lon: 0_i32,
13615 alt: 0_i32,
13616 dgps_age: 0_u32,
13617 eph: 0_u16,
13618 epv: 0_u16,
13619 vel: 0_u16,
13620 cog: 0_u16,
13621 fix_type: GpsFixType::DEFAULT,
13622 satellites_visible: 0_u8,
13623 dgps_numch: 0_u8,
13624 yaw: 0_u16,
13625 alt_ellipsoid: 0_i32,
13626 h_acc: 0_u32,
13627 v_acc: 0_u32,
13628 vel_acc: 0_u32,
13629 hdg_acc: 0_u32,
13630 };
13631 #[cfg(feature = "arbitrary")]
13632 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13633 use arbitrary::{Arbitrary, Unstructured};
13634 let mut buf = [0u8; 1024];
13635 rng.fill_bytes(&mut buf);
13636 let mut unstructured = Unstructured::new(&buf);
13637 Self::arbitrary(&mut unstructured).unwrap_or_default()
13638 }
13639}
13640impl Default for GPS2_RAW_DATA {
13641 fn default() -> Self {
13642 Self::DEFAULT.clone()
13643 }
13644}
13645impl MessageData for GPS2_RAW_DATA {
13646 type Message = MavMessage;
13647 const ID: u32 = 124u32;
13648 const NAME: &'static str = "GPS2_RAW";
13649 const EXTRA_CRC: u8 = 87u8;
13650 const ENCODED_LEN: usize = 57usize;
13651 fn deser(
13652 _version: MavlinkVersion,
13653 __input: &[u8],
13654 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13655 let avail_len = __input.len();
13656 let mut payload_buf = [0; Self::ENCODED_LEN];
13657 let mut buf = if avail_len < Self::ENCODED_LEN {
13658 payload_buf[0..avail_len].copy_from_slice(__input);
13659 Bytes::new(&payload_buf)
13660 } else {
13661 Bytes::new(__input)
13662 };
13663 let mut __struct = Self::default();
13664 __struct.time_usec = buf.get_u64_le();
13665 __struct.lat = buf.get_i32_le();
13666 __struct.lon = buf.get_i32_le();
13667 __struct.alt = buf.get_i32_le();
13668 __struct.dgps_age = buf.get_u32_le();
13669 __struct.eph = buf.get_u16_le();
13670 __struct.epv = buf.get_u16_le();
13671 __struct.vel = buf.get_u16_le();
13672 __struct.cog = buf.get_u16_le();
13673 let tmp = buf.get_u8();
13674 __struct.fix_type =
13675 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13676 enum_type: "GpsFixType",
13677 value: tmp as u32,
13678 })?;
13679 __struct.satellites_visible = buf.get_u8();
13680 __struct.dgps_numch = buf.get_u8();
13681 __struct.yaw = buf.get_u16_le();
13682 __struct.alt_ellipsoid = buf.get_i32_le();
13683 __struct.h_acc = buf.get_u32_le();
13684 __struct.v_acc = buf.get_u32_le();
13685 __struct.vel_acc = buf.get_u32_le();
13686 __struct.hdg_acc = buf.get_u32_le();
13687 Ok(__struct)
13688 }
13689 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13690 let mut __tmp = BytesMut::new(bytes);
13691 #[allow(clippy::absurd_extreme_comparisons)]
13692 #[allow(unused_comparisons)]
13693 if __tmp.remaining() < Self::ENCODED_LEN {
13694 panic!(
13695 "buffer is too small (need {} bytes, but got {})",
13696 Self::ENCODED_LEN,
13697 __tmp.remaining(),
13698 )
13699 }
13700 __tmp.put_u64_le(self.time_usec);
13701 __tmp.put_i32_le(self.lat);
13702 __tmp.put_i32_le(self.lon);
13703 __tmp.put_i32_le(self.alt);
13704 __tmp.put_u32_le(self.dgps_age);
13705 __tmp.put_u16_le(self.eph);
13706 __tmp.put_u16_le(self.epv);
13707 __tmp.put_u16_le(self.vel);
13708 __tmp.put_u16_le(self.cog);
13709 __tmp.put_u8(self.fix_type as u8);
13710 __tmp.put_u8(self.satellites_visible);
13711 __tmp.put_u8(self.dgps_numch);
13712 __tmp.put_u16_le(self.yaw);
13713 __tmp.put_i32_le(self.alt_ellipsoid);
13714 __tmp.put_u32_le(self.h_acc);
13715 __tmp.put_u32_le(self.v_acc);
13716 __tmp.put_u32_le(self.vel_acc);
13717 __tmp.put_u32_le(self.hdg_acc);
13718 if matches!(version, MavlinkVersion::V2) {
13719 let len = __tmp.len();
13720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13721 } else {
13722 __tmp.len()
13723 }
13724 }
13725}
13726#[doc = "id: 128"]
13727#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13728#[derive(Debug, Clone, PartialEq)]
13729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13731pub struct GPS2_RTK_DATA {
13732 #[doc = "Time since boot of last baseline message received."]
13733 pub time_last_baseline_ms: u32,
13734 #[doc = "GPS Time of Week of last baseline"]
13735 pub tow: u32,
13736 #[doc = "Current baseline in ECEF x or NED north component."]
13737 pub baseline_a_mm: i32,
13738 #[doc = "Current baseline in ECEF y or NED east component."]
13739 pub baseline_b_mm: i32,
13740 #[doc = "Current baseline in ECEF z or NED down component."]
13741 pub baseline_c_mm: i32,
13742 #[doc = "Current estimate of baseline accuracy."]
13743 pub accuracy: u32,
13744 #[doc = "Current number of integer ambiguity hypotheses."]
13745 pub iar_num_hypotheses: i32,
13746 #[doc = "GPS Week Number of last baseline"]
13747 pub wn: u16,
13748 #[doc = "Identification of connected RTK receiver."]
13749 pub rtk_receiver_id: u8,
13750 #[doc = "GPS-specific health report for RTK data."]
13751 pub rtk_health: u8,
13752 #[doc = "Rate of baseline messages being received by GPS"]
13753 pub rtk_rate: u8,
13754 #[doc = "Current number of sats used for RTK calculation."]
13755 pub nsats: u8,
13756 #[doc = "Coordinate system of baseline"]
13757 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13758}
13759impl GPS2_RTK_DATA {
13760 pub const ENCODED_LEN: usize = 35usize;
13761 pub const DEFAULT: Self = Self {
13762 time_last_baseline_ms: 0_u32,
13763 tow: 0_u32,
13764 baseline_a_mm: 0_i32,
13765 baseline_b_mm: 0_i32,
13766 baseline_c_mm: 0_i32,
13767 accuracy: 0_u32,
13768 iar_num_hypotheses: 0_i32,
13769 wn: 0_u16,
13770 rtk_receiver_id: 0_u8,
13771 rtk_health: 0_u8,
13772 rtk_rate: 0_u8,
13773 nsats: 0_u8,
13774 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13775 };
13776 #[cfg(feature = "arbitrary")]
13777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13778 use arbitrary::{Arbitrary, Unstructured};
13779 let mut buf = [0u8; 1024];
13780 rng.fill_bytes(&mut buf);
13781 let mut unstructured = Unstructured::new(&buf);
13782 Self::arbitrary(&mut unstructured).unwrap_or_default()
13783 }
13784}
13785impl Default for GPS2_RTK_DATA {
13786 fn default() -> Self {
13787 Self::DEFAULT.clone()
13788 }
13789}
13790impl MessageData for GPS2_RTK_DATA {
13791 type Message = MavMessage;
13792 const ID: u32 = 128u32;
13793 const NAME: &'static str = "GPS2_RTK";
13794 const EXTRA_CRC: u8 = 226u8;
13795 const ENCODED_LEN: usize = 35usize;
13796 fn deser(
13797 _version: MavlinkVersion,
13798 __input: &[u8],
13799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13800 let avail_len = __input.len();
13801 let mut payload_buf = [0; Self::ENCODED_LEN];
13802 let mut buf = if avail_len < Self::ENCODED_LEN {
13803 payload_buf[0..avail_len].copy_from_slice(__input);
13804 Bytes::new(&payload_buf)
13805 } else {
13806 Bytes::new(__input)
13807 };
13808 let mut __struct = Self::default();
13809 __struct.time_last_baseline_ms = buf.get_u32_le();
13810 __struct.tow = buf.get_u32_le();
13811 __struct.baseline_a_mm = buf.get_i32_le();
13812 __struct.baseline_b_mm = buf.get_i32_le();
13813 __struct.baseline_c_mm = buf.get_i32_le();
13814 __struct.accuracy = buf.get_u32_le();
13815 __struct.iar_num_hypotheses = buf.get_i32_le();
13816 __struct.wn = buf.get_u16_le();
13817 __struct.rtk_receiver_id = buf.get_u8();
13818 __struct.rtk_health = buf.get_u8();
13819 __struct.rtk_rate = buf.get_u8();
13820 __struct.nsats = buf.get_u8();
13821 let tmp = buf.get_u8();
13822 __struct.baseline_coords_type =
13823 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13824 enum_type: "RtkBaselineCoordinateSystem",
13825 value: tmp as u32,
13826 })?;
13827 Ok(__struct)
13828 }
13829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13830 let mut __tmp = BytesMut::new(bytes);
13831 #[allow(clippy::absurd_extreme_comparisons)]
13832 #[allow(unused_comparisons)]
13833 if __tmp.remaining() < Self::ENCODED_LEN {
13834 panic!(
13835 "buffer is too small (need {} bytes, but got {})",
13836 Self::ENCODED_LEN,
13837 __tmp.remaining(),
13838 )
13839 }
13840 __tmp.put_u32_le(self.time_last_baseline_ms);
13841 __tmp.put_u32_le(self.tow);
13842 __tmp.put_i32_le(self.baseline_a_mm);
13843 __tmp.put_i32_le(self.baseline_b_mm);
13844 __tmp.put_i32_le(self.baseline_c_mm);
13845 __tmp.put_u32_le(self.accuracy);
13846 __tmp.put_i32_le(self.iar_num_hypotheses);
13847 __tmp.put_u16_le(self.wn);
13848 __tmp.put_u8(self.rtk_receiver_id);
13849 __tmp.put_u8(self.rtk_health);
13850 __tmp.put_u8(self.rtk_rate);
13851 __tmp.put_u8(self.nsats);
13852 __tmp.put_u8(self.baseline_coords_type as u8);
13853 if matches!(version, MavlinkVersion::V2) {
13854 let len = __tmp.len();
13855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13856 } else {
13857 __tmp.len()
13858 }
13859 }
13860}
13861#[doc = "id: 49"]
13862#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13863#[derive(Debug, Clone, PartialEq)]
13864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13866pub struct GPS_GLOBAL_ORIGIN_DATA {
13867 #[doc = "Latitude (WGS84)"]
13868 pub latitude: i32,
13869 #[doc = "Longitude (WGS84)"]
13870 pub longitude: i32,
13871 #[doc = "Altitude (MSL). Positive for up."]
13872 pub altitude: i32,
13873 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13874 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13875 pub time_usec: u64,
13876}
13877impl GPS_GLOBAL_ORIGIN_DATA {
13878 pub const ENCODED_LEN: usize = 20usize;
13879 pub const DEFAULT: Self = Self {
13880 latitude: 0_i32,
13881 longitude: 0_i32,
13882 altitude: 0_i32,
13883 time_usec: 0_u64,
13884 };
13885 #[cfg(feature = "arbitrary")]
13886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13887 use arbitrary::{Arbitrary, Unstructured};
13888 let mut buf = [0u8; 1024];
13889 rng.fill_bytes(&mut buf);
13890 let mut unstructured = Unstructured::new(&buf);
13891 Self::arbitrary(&mut unstructured).unwrap_or_default()
13892 }
13893}
13894impl Default for GPS_GLOBAL_ORIGIN_DATA {
13895 fn default() -> Self {
13896 Self::DEFAULT.clone()
13897 }
13898}
13899impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13900 type Message = MavMessage;
13901 const ID: u32 = 49u32;
13902 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13903 const EXTRA_CRC: u8 = 39u8;
13904 const ENCODED_LEN: usize = 20usize;
13905 fn deser(
13906 _version: MavlinkVersion,
13907 __input: &[u8],
13908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13909 let avail_len = __input.len();
13910 let mut payload_buf = [0; Self::ENCODED_LEN];
13911 let mut buf = if avail_len < Self::ENCODED_LEN {
13912 payload_buf[0..avail_len].copy_from_slice(__input);
13913 Bytes::new(&payload_buf)
13914 } else {
13915 Bytes::new(__input)
13916 };
13917 let mut __struct = Self::default();
13918 __struct.latitude = buf.get_i32_le();
13919 __struct.longitude = buf.get_i32_le();
13920 __struct.altitude = buf.get_i32_le();
13921 __struct.time_usec = buf.get_u64_le();
13922 Ok(__struct)
13923 }
13924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13925 let mut __tmp = BytesMut::new(bytes);
13926 #[allow(clippy::absurd_extreme_comparisons)]
13927 #[allow(unused_comparisons)]
13928 if __tmp.remaining() < Self::ENCODED_LEN {
13929 panic!(
13930 "buffer is too small (need {} bytes, but got {})",
13931 Self::ENCODED_LEN,
13932 __tmp.remaining(),
13933 )
13934 }
13935 __tmp.put_i32_le(self.latitude);
13936 __tmp.put_i32_le(self.longitude);
13937 __tmp.put_i32_le(self.altitude);
13938 __tmp.put_u64_le(self.time_usec);
13939 if matches!(version, MavlinkVersion::V2) {
13940 let len = __tmp.len();
13941 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13942 } else {
13943 __tmp.len()
13944 }
13945 }
13946}
13947#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13948#[doc = "id: 123"]
13949#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13950#[derive(Debug, Clone, PartialEq)]
13951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13953pub struct GPS_INJECT_DATA_DATA {
13954 #[doc = "System ID"]
13955 pub target_system: u8,
13956 #[doc = "Component ID"]
13957 pub target_component: u8,
13958 #[doc = "Data length"]
13959 pub len: u8,
13960 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13962 pub data: [u8; 110],
13963}
13964impl GPS_INJECT_DATA_DATA {
13965 pub const ENCODED_LEN: usize = 113usize;
13966 pub const DEFAULT: Self = Self {
13967 target_system: 0_u8,
13968 target_component: 0_u8,
13969 len: 0_u8,
13970 data: [0_u8; 110usize],
13971 };
13972 #[cfg(feature = "arbitrary")]
13973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13974 use arbitrary::{Arbitrary, Unstructured};
13975 let mut buf = [0u8; 1024];
13976 rng.fill_bytes(&mut buf);
13977 let mut unstructured = Unstructured::new(&buf);
13978 Self::arbitrary(&mut unstructured).unwrap_or_default()
13979 }
13980}
13981impl Default for GPS_INJECT_DATA_DATA {
13982 fn default() -> Self {
13983 Self::DEFAULT.clone()
13984 }
13985}
13986impl MessageData for GPS_INJECT_DATA_DATA {
13987 type Message = MavMessage;
13988 const ID: u32 = 123u32;
13989 const NAME: &'static str = "GPS_INJECT_DATA";
13990 const EXTRA_CRC: u8 = 250u8;
13991 const ENCODED_LEN: usize = 113usize;
13992 fn deser(
13993 _version: MavlinkVersion,
13994 __input: &[u8],
13995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13996 let avail_len = __input.len();
13997 let mut payload_buf = [0; Self::ENCODED_LEN];
13998 let mut buf = if avail_len < Self::ENCODED_LEN {
13999 payload_buf[0..avail_len].copy_from_slice(__input);
14000 Bytes::new(&payload_buf)
14001 } else {
14002 Bytes::new(__input)
14003 };
14004 let mut __struct = Self::default();
14005 __struct.target_system = buf.get_u8();
14006 __struct.target_component = buf.get_u8();
14007 __struct.len = buf.get_u8();
14008 for v in &mut __struct.data {
14009 let val = buf.get_u8();
14010 *v = val;
14011 }
14012 Ok(__struct)
14013 }
14014 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14015 let mut __tmp = BytesMut::new(bytes);
14016 #[allow(clippy::absurd_extreme_comparisons)]
14017 #[allow(unused_comparisons)]
14018 if __tmp.remaining() < Self::ENCODED_LEN {
14019 panic!(
14020 "buffer is too small (need {} bytes, but got {})",
14021 Self::ENCODED_LEN,
14022 __tmp.remaining(),
14023 )
14024 }
14025 __tmp.put_u8(self.target_system);
14026 __tmp.put_u8(self.target_component);
14027 __tmp.put_u8(self.len);
14028 for val in &self.data {
14029 __tmp.put_u8(*val);
14030 }
14031 if matches!(version, MavlinkVersion::V2) {
14032 let len = __tmp.len();
14033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14034 } else {
14035 __tmp.len()
14036 }
14037 }
14038}
14039#[doc = "id: 232"]
14040#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14041#[derive(Debug, Clone, PartialEq)]
14042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14044pub struct GPS_INPUT_DATA {
14045 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14046 pub time_usec: u64,
14047 #[doc = "GPS time (from start of GPS week)"]
14048 pub time_week_ms: u32,
14049 #[doc = "Latitude (WGS84)"]
14050 pub lat: i32,
14051 #[doc = "Longitude (WGS84)"]
14052 pub lon: i32,
14053 #[doc = "Altitude (MSL). Positive for up."]
14054 pub alt: f32,
14055 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14056 pub hdop: f32,
14057 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14058 pub vdop: f32,
14059 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14060 pub vn: f32,
14061 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14062 pub ve: f32,
14063 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14064 pub vd: f32,
14065 #[doc = "GPS speed accuracy"]
14066 pub speed_accuracy: f32,
14067 #[doc = "GPS horizontal accuracy"]
14068 pub horiz_accuracy: f32,
14069 #[doc = "GPS vertical accuracy"]
14070 pub vert_accuracy: f32,
14071 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14072 pub ignore_flags: GpsInputIgnoreFlags,
14073 #[doc = "GPS week number"]
14074 pub time_week: u16,
14075 #[doc = "ID of the GPS for multiple GPS inputs"]
14076 pub gps_id: u8,
14077 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14078 pub fix_type: u8,
14079 #[doc = "Number of satellites visible."]
14080 pub satellites_visible: u8,
14081 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14082 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14083 pub yaw: u16,
14084}
14085impl GPS_INPUT_DATA {
14086 pub const ENCODED_LEN: usize = 65usize;
14087 pub const DEFAULT: Self = Self {
14088 time_usec: 0_u64,
14089 time_week_ms: 0_u32,
14090 lat: 0_i32,
14091 lon: 0_i32,
14092 alt: 0.0_f32,
14093 hdop: 0.0_f32,
14094 vdop: 0.0_f32,
14095 vn: 0.0_f32,
14096 ve: 0.0_f32,
14097 vd: 0.0_f32,
14098 speed_accuracy: 0.0_f32,
14099 horiz_accuracy: 0.0_f32,
14100 vert_accuracy: 0.0_f32,
14101 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14102 time_week: 0_u16,
14103 gps_id: 0_u8,
14104 fix_type: 0_u8,
14105 satellites_visible: 0_u8,
14106 yaw: 0_u16,
14107 };
14108 #[cfg(feature = "arbitrary")]
14109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14110 use arbitrary::{Arbitrary, Unstructured};
14111 let mut buf = [0u8; 1024];
14112 rng.fill_bytes(&mut buf);
14113 let mut unstructured = Unstructured::new(&buf);
14114 Self::arbitrary(&mut unstructured).unwrap_or_default()
14115 }
14116}
14117impl Default for GPS_INPUT_DATA {
14118 fn default() -> Self {
14119 Self::DEFAULT.clone()
14120 }
14121}
14122impl MessageData for GPS_INPUT_DATA {
14123 type Message = MavMessage;
14124 const ID: u32 = 232u32;
14125 const NAME: &'static str = "GPS_INPUT";
14126 const EXTRA_CRC: u8 = 151u8;
14127 const ENCODED_LEN: usize = 65usize;
14128 fn deser(
14129 _version: MavlinkVersion,
14130 __input: &[u8],
14131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14132 let avail_len = __input.len();
14133 let mut payload_buf = [0; Self::ENCODED_LEN];
14134 let mut buf = if avail_len < Self::ENCODED_LEN {
14135 payload_buf[0..avail_len].copy_from_slice(__input);
14136 Bytes::new(&payload_buf)
14137 } else {
14138 Bytes::new(__input)
14139 };
14140 let mut __struct = Self::default();
14141 __struct.time_usec = buf.get_u64_le();
14142 __struct.time_week_ms = buf.get_u32_le();
14143 __struct.lat = buf.get_i32_le();
14144 __struct.lon = buf.get_i32_le();
14145 __struct.alt = buf.get_f32_le();
14146 __struct.hdop = buf.get_f32_le();
14147 __struct.vdop = buf.get_f32_le();
14148 __struct.vn = buf.get_f32_le();
14149 __struct.ve = buf.get_f32_le();
14150 __struct.vd = buf.get_f32_le();
14151 __struct.speed_accuracy = buf.get_f32_le();
14152 __struct.horiz_accuracy = buf.get_f32_le();
14153 __struct.vert_accuracy = buf.get_f32_le();
14154 let tmp = buf.get_u16_le();
14155 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14156 tmp & GpsInputIgnoreFlags::all().bits(),
14157 )
14158 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14159 flag_type: "GpsInputIgnoreFlags",
14160 value: tmp as u32,
14161 })?;
14162 __struct.time_week = buf.get_u16_le();
14163 __struct.gps_id = buf.get_u8();
14164 __struct.fix_type = buf.get_u8();
14165 __struct.satellites_visible = buf.get_u8();
14166 __struct.yaw = buf.get_u16_le();
14167 Ok(__struct)
14168 }
14169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14170 let mut __tmp = BytesMut::new(bytes);
14171 #[allow(clippy::absurd_extreme_comparisons)]
14172 #[allow(unused_comparisons)]
14173 if __tmp.remaining() < Self::ENCODED_LEN {
14174 panic!(
14175 "buffer is too small (need {} bytes, but got {})",
14176 Self::ENCODED_LEN,
14177 __tmp.remaining(),
14178 )
14179 }
14180 __tmp.put_u64_le(self.time_usec);
14181 __tmp.put_u32_le(self.time_week_ms);
14182 __tmp.put_i32_le(self.lat);
14183 __tmp.put_i32_le(self.lon);
14184 __tmp.put_f32_le(self.alt);
14185 __tmp.put_f32_le(self.hdop);
14186 __tmp.put_f32_le(self.vdop);
14187 __tmp.put_f32_le(self.vn);
14188 __tmp.put_f32_le(self.ve);
14189 __tmp.put_f32_le(self.vd);
14190 __tmp.put_f32_le(self.speed_accuracy);
14191 __tmp.put_f32_le(self.horiz_accuracy);
14192 __tmp.put_f32_le(self.vert_accuracy);
14193 __tmp.put_u16_le(self.ignore_flags.bits());
14194 __tmp.put_u16_le(self.time_week);
14195 __tmp.put_u8(self.gps_id);
14196 __tmp.put_u8(self.fix_type);
14197 __tmp.put_u8(self.satellites_visible);
14198 __tmp.put_u16_le(self.yaw);
14199 if matches!(version, MavlinkVersion::V2) {
14200 let len = __tmp.len();
14201 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14202 } else {
14203 __tmp.len()
14204 }
14205 }
14206}
14207#[doc = "id: 24"]
14208#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14209#[derive(Debug, Clone, PartialEq)]
14210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14212pub struct GPS_RAW_INT_DATA {
14213 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14214 pub time_usec: u64,
14215 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14216 pub lat: i32,
14217 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14218 pub lon: i32,
14219 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14220 pub alt: i32,
14221 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14222 pub eph: u16,
14223 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14224 pub epv: u16,
14225 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14226 pub vel: u16,
14227 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14228 pub cog: u16,
14229 #[doc = "GPS fix type."]
14230 pub fix_type: GpsFixType,
14231 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14232 pub satellites_visible: u8,
14233 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14235 pub alt_ellipsoid: i32,
14236 #[doc = "Position uncertainty."]
14237 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14238 pub h_acc: u32,
14239 #[doc = "Altitude uncertainty."]
14240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14241 pub v_acc: u32,
14242 #[doc = "Speed uncertainty."]
14243 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14244 pub vel_acc: u32,
14245 #[doc = "Heading / track uncertainty"]
14246 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14247 pub hdg_acc: u32,
14248 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14249 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14250 pub yaw: u16,
14251}
14252impl GPS_RAW_INT_DATA {
14253 pub const ENCODED_LEN: usize = 52usize;
14254 pub const DEFAULT: Self = Self {
14255 time_usec: 0_u64,
14256 lat: 0_i32,
14257 lon: 0_i32,
14258 alt: 0_i32,
14259 eph: 0_u16,
14260 epv: 0_u16,
14261 vel: 0_u16,
14262 cog: 0_u16,
14263 fix_type: GpsFixType::DEFAULT,
14264 satellites_visible: 0_u8,
14265 alt_ellipsoid: 0_i32,
14266 h_acc: 0_u32,
14267 v_acc: 0_u32,
14268 vel_acc: 0_u32,
14269 hdg_acc: 0_u32,
14270 yaw: 0_u16,
14271 };
14272 #[cfg(feature = "arbitrary")]
14273 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14274 use arbitrary::{Arbitrary, Unstructured};
14275 let mut buf = [0u8; 1024];
14276 rng.fill_bytes(&mut buf);
14277 let mut unstructured = Unstructured::new(&buf);
14278 Self::arbitrary(&mut unstructured).unwrap_or_default()
14279 }
14280}
14281impl Default for GPS_RAW_INT_DATA {
14282 fn default() -> Self {
14283 Self::DEFAULT.clone()
14284 }
14285}
14286impl MessageData for GPS_RAW_INT_DATA {
14287 type Message = MavMessage;
14288 const ID: u32 = 24u32;
14289 const NAME: &'static str = "GPS_RAW_INT";
14290 const EXTRA_CRC: u8 = 24u8;
14291 const ENCODED_LEN: usize = 52usize;
14292 fn deser(
14293 _version: MavlinkVersion,
14294 __input: &[u8],
14295 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14296 let avail_len = __input.len();
14297 let mut payload_buf = [0; Self::ENCODED_LEN];
14298 let mut buf = if avail_len < Self::ENCODED_LEN {
14299 payload_buf[0..avail_len].copy_from_slice(__input);
14300 Bytes::new(&payload_buf)
14301 } else {
14302 Bytes::new(__input)
14303 };
14304 let mut __struct = Self::default();
14305 __struct.time_usec = buf.get_u64_le();
14306 __struct.lat = buf.get_i32_le();
14307 __struct.lon = buf.get_i32_le();
14308 __struct.alt = buf.get_i32_le();
14309 __struct.eph = buf.get_u16_le();
14310 __struct.epv = buf.get_u16_le();
14311 __struct.vel = buf.get_u16_le();
14312 __struct.cog = buf.get_u16_le();
14313 let tmp = buf.get_u8();
14314 __struct.fix_type =
14315 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14316 enum_type: "GpsFixType",
14317 value: tmp as u32,
14318 })?;
14319 __struct.satellites_visible = buf.get_u8();
14320 __struct.alt_ellipsoid = buf.get_i32_le();
14321 __struct.h_acc = buf.get_u32_le();
14322 __struct.v_acc = buf.get_u32_le();
14323 __struct.vel_acc = buf.get_u32_le();
14324 __struct.hdg_acc = buf.get_u32_le();
14325 __struct.yaw = buf.get_u16_le();
14326 Ok(__struct)
14327 }
14328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14329 let mut __tmp = BytesMut::new(bytes);
14330 #[allow(clippy::absurd_extreme_comparisons)]
14331 #[allow(unused_comparisons)]
14332 if __tmp.remaining() < Self::ENCODED_LEN {
14333 panic!(
14334 "buffer is too small (need {} bytes, but got {})",
14335 Self::ENCODED_LEN,
14336 __tmp.remaining(),
14337 )
14338 }
14339 __tmp.put_u64_le(self.time_usec);
14340 __tmp.put_i32_le(self.lat);
14341 __tmp.put_i32_le(self.lon);
14342 __tmp.put_i32_le(self.alt);
14343 __tmp.put_u16_le(self.eph);
14344 __tmp.put_u16_le(self.epv);
14345 __tmp.put_u16_le(self.vel);
14346 __tmp.put_u16_le(self.cog);
14347 __tmp.put_u8(self.fix_type as u8);
14348 __tmp.put_u8(self.satellites_visible);
14349 __tmp.put_i32_le(self.alt_ellipsoid);
14350 __tmp.put_u32_le(self.h_acc);
14351 __tmp.put_u32_le(self.v_acc);
14352 __tmp.put_u32_le(self.vel_acc);
14353 __tmp.put_u32_le(self.hdg_acc);
14354 __tmp.put_u16_le(self.yaw);
14355 if matches!(version, MavlinkVersion::V2) {
14356 let len = __tmp.len();
14357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14358 } else {
14359 __tmp.len()
14360 }
14361 }
14362}
14363#[doc = "id: 233"]
14364#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14365#[derive(Debug, Clone, PartialEq)]
14366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14368pub struct GPS_RTCM_DATA_DATA {
14369 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14370 pub flags: u8,
14371 #[doc = "data length"]
14372 pub len: u8,
14373 #[doc = "RTCM message (may be fragmented)"]
14374 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14375 pub data: [u8; 180],
14376}
14377impl GPS_RTCM_DATA_DATA {
14378 pub const ENCODED_LEN: usize = 182usize;
14379 pub const DEFAULT: Self = Self {
14380 flags: 0_u8,
14381 len: 0_u8,
14382 data: [0_u8; 180usize],
14383 };
14384 #[cfg(feature = "arbitrary")]
14385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14386 use arbitrary::{Arbitrary, Unstructured};
14387 let mut buf = [0u8; 1024];
14388 rng.fill_bytes(&mut buf);
14389 let mut unstructured = Unstructured::new(&buf);
14390 Self::arbitrary(&mut unstructured).unwrap_or_default()
14391 }
14392}
14393impl Default for GPS_RTCM_DATA_DATA {
14394 fn default() -> Self {
14395 Self::DEFAULT.clone()
14396 }
14397}
14398impl MessageData for GPS_RTCM_DATA_DATA {
14399 type Message = MavMessage;
14400 const ID: u32 = 233u32;
14401 const NAME: &'static str = "GPS_RTCM_DATA";
14402 const EXTRA_CRC: u8 = 35u8;
14403 const ENCODED_LEN: usize = 182usize;
14404 fn deser(
14405 _version: MavlinkVersion,
14406 __input: &[u8],
14407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14408 let avail_len = __input.len();
14409 let mut payload_buf = [0; Self::ENCODED_LEN];
14410 let mut buf = if avail_len < Self::ENCODED_LEN {
14411 payload_buf[0..avail_len].copy_from_slice(__input);
14412 Bytes::new(&payload_buf)
14413 } else {
14414 Bytes::new(__input)
14415 };
14416 let mut __struct = Self::default();
14417 __struct.flags = buf.get_u8();
14418 __struct.len = buf.get_u8();
14419 for v in &mut __struct.data {
14420 let val = buf.get_u8();
14421 *v = val;
14422 }
14423 Ok(__struct)
14424 }
14425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14426 let mut __tmp = BytesMut::new(bytes);
14427 #[allow(clippy::absurd_extreme_comparisons)]
14428 #[allow(unused_comparisons)]
14429 if __tmp.remaining() < Self::ENCODED_LEN {
14430 panic!(
14431 "buffer is too small (need {} bytes, but got {})",
14432 Self::ENCODED_LEN,
14433 __tmp.remaining(),
14434 )
14435 }
14436 __tmp.put_u8(self.flags);
14437 __tmp.put_u8(self.len);
14438 for val in &self.data {
14439 __tmp.put_u8(*val);
14440 }
14441 if matches!(version, MavlinkVersion::V2) {
14442 let len = __tmp.len();
14443 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14444 } else {
14445 __tmp.len()
14446 }
14447 }
14448}
14449#[doc = "id: 127"]
14450#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14451#[derive(Debug, Clone, PartialEq)]
14452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14454pub struct GPS_RTK_DATA {
14455 #[doc = "Time since boot of last baseline message received."]
14456 pub time_last_baseline_ms: u32,
14457 #[doc = "GPS Time of Week of last baseline"]
14458 pub tow: u32,
14459 #[doc = "Current baseline in ECEF x or NED north component."]
14460 pub baseline_a_mm: i32,
14461 #[doc = "Current baseline in ECEF y or NED east component."]
14462 pub baseline_b_mm: i32,
14463 #[doc = "Current baseline in ECEF z or NED down component."]
14464 pub baseline_c_mm: i32,
14465 #[doc = "Current estimate of baseline accuracy."]
14466 pub accuracy: u32,
14467 #[doc = "Current number of integer ambiguity hypotheses."]
14468 pub iar_num_hypotheses: i32,
14469 #[doc = "GPS Week Number of last baseline"]
14470 pub wn: u16,
14471 #[doc = "Identification of connected RTK receiver."]
14472 pub rtk_receiver_id: u8,
14473 #[doc = "GPS-specific health report for RTK data."]
14474 pub rtk_health: u8,
14475 #[doc = "Rate of baseline messages being received by GPS"]
14476 pub rtk_rate: u8,
14477 #[doc = "Current number of sats used for RTK calculation."]
14478 pub nsats: u8,
14479 #[doc = "Coordinate system of baseline"]
14480 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14481}
14482impl GPS_RTK_DATA {
14483 pub const ENCODED_LEN: usize = 35usize;
14484 pub const DEFAULT: Self = Self {
14485 time_last_baseline_ms: 0_u32,
14486 tow: 0_u32,
14487 baseline_a_mm: 0_i32,
14488 baseline_b_mm: 0_i32,
14489 baseline_c_mm: 0_i32,
14490 accuracy: 0_u32,
14491 iar_num_hypotheses: 0_i32,
14492 wn: 0_u16,
14493 rtk_receiver_id: 0_u8,
14494 rtk_health: 0_u8,
14495 rtk_rate: 0_u8,
14496 nsats: 0_u8,
14497 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14498 };
14499 #[cfg(feature = "arbitrary")]
14500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14501 use arbitrary::{Arbitrary, Unstructured};
14502 let mut buf = [0u8; 1024];
14503 rng.fill_bytes(&mut buf);
14504 let mut unstructured = Unstructured::new(&buf);
14505 Self::arbitrary(&mut unstructured).unwrap_or_default()
14506 }
14507}
14508impl Default for GPS_RTK_DATA {
14509 fn default() -> Self {
14510 Self::DEFAULT.clone()
14511 }
14512}
14513impl MessageData for GPS_RTK_DATA {
14514 type Message = MavMessage;
14515 const ID: u32 = 127u32;
14516 const NAME: &'static str = "GPS_RTK";
14517 const EXTRA_CRC: u8 = 25u8;
14518 const ENCODED_LEN: usize = 35usize;
14519 fn deser(
14520 _version: MavlinkVersion,
14521 __input: &[u8],
14522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14523 let avail_len = __input.len();
14524 let mut payload_buf = [0; Self::ENCODED_LEN];
14525 let mut buf = if avail_len < Self::ENCODED_LEN {
14526 payload_buf[0..avail_len].copy_from_slice(__input);
14527 Bytes::new(&payload_buf)
14528 } else {
14529 Bytes::new(__input)
14530 };
14531 let mut __struct = Self::default();
14532 __struct.time_last_baseline_ms = buf.get_u32_le();
14533 __struct.tow = buf.get_u32_le();
14534 __struct.baseline_a_mm = buf.get_i32_le();
14535 __struct.baseline_b_mm = buf.get_i32_le();
14536 __struct.baseline_c_mm = buf.get_i32_le();
14537 __struct.accuracy = buf.get_u32_le();
14538 __struct.iar_num_hypotheses = buf.get_i32_le();
14539 __struct.wn = buf.get_u16_le();
14540 __struct.rtk_receiver_id = buf.get_u8();
14541 __struct.rtk_health = buf.get_u8();
14542 __struct.rtk_rate = buf.get_u8();
14543 __struct.nsats = buf.get_u8();
14544 let tmp = buf.get_u8();
14545 __struct.baseline_coords_type =
14546 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14547 enum_type: "RtkBaselineCoordinateSystem",
14548 value: tmp as u32,
14549 })?;
14550 Ok(__struct)
14551 }
14552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14553 let mut __tmp = BytesMut::new(bytes);
14554 #[allow(clippy::absurd_extreme_comparisons)]
14555 #[allow(unused_comparisons)]
14556 if __tmp.remaining() < Self::ENCODED_LEN {
14557 panic!(
14558 "buffer is too small (need {} bytes, but got {})",
14559 Self::ENCODED_LEN,
14560 __tmp.remaining(),
14561 )
14562 }
14563 __tmp.put_u32_le(self.time_last_baseline_ms);
14564 __tmp.put_u32_le(self.tow);
14565 __tmp.put_i32_le(self.baseline_a_mm);
14566 __tmp.put_i32_le(self.baseline_b_mm);
14567 __tmp.put_i32_le(self.baseline_c_mm);
14568 __tmp.put_u32_le(self.accuracy);
14569 __tmp.put_i32_le(self.iar_num_hypotheses);
14570 __tmp.put_u16_le(self.wn);
14571 __tmp.put_u8(self.rtk_receiver_id);
14572 __tmp.put_u8(self.rtk_health);
14573 __tmp.put_u8(self.rtk_rate);
14574 __tmp.put_u8(self.nsats);
14575 __tmp.put_u8(self.baseline_coords_type as u8);
14576 if matches!(version, MavlinkVersion::V2) {
14577 let len = __tmp.len();
14578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14579 } else {
14580 __tmp.len()
14581 }
14582 }
14583}
14584#[doc = "id: 25"]
14585#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14586#[derive(Debug, Clone, PartialEq)]
14587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14589pub struct GPS_STATUS_DATA {
14590 #[doc = "Number of satellites visible"]
14591 pub satellites_visible: u8,
14592 #[doc = "Global satellite ID"]
14593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14594 pub satellite_prn: [u8; 20],
14595 #[doc = "0: Satellite not used, 1: used for localization"]
14596 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14597 pub satellite_used: [u8; 20],
14598 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14599 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14600 pub satellite_elevation: [u8; 20],
14601 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14603 pub satellite_azimuth: [u8; 20],
14604 #[doc = "Signal to noise ratio of satellite"]
14605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14606 pub satellite_snr: [u8; 20],
14607}
14608impl GPS_STATUS_DATA {
14609 pub const ENCODED_LEN: usize = 101usize;
14610 pub const DEFAULT: Self = Self {
14611 satellites_visible: 0_u8,
14612 satellite_prn: [0_u8; 20usize],
14613 satellite_used: [0_u8; 20usize],
14614 satellite_elevation: [0_u8; 20usize],
14615 satellite_azimuth: [0_u8; 20usize],
14616 satellite_snr: [0_u8; 20usize],
14617 };
14618 #[cfg(feature = "arbitrary")]
14619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14620 use arbitrary::{Arbitrary, Unstructured};
14621 let mut buf = [0u8; 1024];
14622 rng.fill_bytes(&mut buf);
14623 let mut unstructured = Unstructured::new(&buf);
14624 Self::arbitrary(&mut unstructured).unwrap_or_default()
14625 }
14626}
14627impl Default for GPS_STATUS_DATA {
14628 fn default() -> Self {
14629 Self::DEFAULT.clone()
14630 }
14631}
14632impl MessageData for GPS_STATUS_DATA {
14633 type Message = MavMessage;
14634 const ID: u32 = 25u32;
14635 const NAME: &'static str = "GPS_STATUS";
14636 const EXTRA_CRC: u8 = 23u8;
14637 const ENCODED_LEN: usize = 101usize;
14638 fn deser(
14639 _version: MavlinkVersion,
14640 __input: &[u8],
14641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14642 let avail_len = __input.len();
14643 let mut payload_buf = [0; Self::ENCODED_LEN];
14644 let mut buf = if avail_len < Self::ENCODED_LEN {
14645 payload_buf[0..avail_len].copy_from_slice(__input);
14646 Bytes::new(&payload_buf)
14647 } else {
14648 Bytes::new(__input)
14649 };
14650 let mut __struct = Self::default();
14651 __struct.satellites_visible = buf.get_u8();
14652 for v in &mut __struct.satellite_prn {
14653 let val = buf.get_u8();
14654 *v = val;
14655 }
14656 for v in &mut __struct.satellite_used {
14657 let val = buf.get_u8();
14658 *v = val;
14659 }
14660 for v in &mut __struct.satellite_elevation {
14661 let val = buf.get_u8();
14662 *v = val;
14663 }
14664 for v in &mut __struct.satellite_azimuth {
14665 let val = buf.get_u8();
14666 *v = val;
14667 }
14668 for v in &mut __struct.satellite_snr {
14669 let val = buf.get_u8();
14670 *v = val;
14671 }
14672 Ok(__struct)
14673 }
14674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14675 let mut __tmp = BytesMut::new(bytes);
14676 #[allow(clippy::absurd_extreme_comparisons)]
14677 #[allow(unused_comparisons)]
14678 if __tmp.remaining() < Self::ENCODED_LEN {
14679 panic!(
14680 "buffer is too small (need {} bytes, but got {})",
14681 Self::ENCODED_LEN,
14682 __tmp.remaining(),
14683 )
14684 }
14685 __tmp.put_u8(self.satellites_visible);
14686 for val in &self.satellite_prn {
14687 __tmp.put_u8(*val);
14688 }
14689 for val in &self.satellite_used {
14690 __tmp.put_u8(*val);
14691 }
14692 for val in &self.satellite_elevation {
14693 __tmp.put_u8(*val);
14694 }
14695 for val in &self.satellite_azimuth {
14696 __tmp.put_u8(*val);
14697 }
14698 for val in &self.satellite_snr {
14699 __tmp.put_u8(*val);
14700 }
14701 if matches!(version, MavlinkVersion::V2) {
14702 let len = __tmp.len();
14703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14704 } else {
14705 __tmp.len()
14706 }
14707 }
14708}
14709#[doc = "id: 0"]
14710#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14711#[derive(Debug, Clone, PartialEq)]
14712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14714pub struct HEARTBEAT_DATA {
14715 #[doc = "A bitfield for use for autopilot-specific flags"]
14716 pub custom_mode: u32,
14717 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14718 pub mavtype: MavType,
14719 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14720 pub autopilot: MavAutopilot,
14721 #[doc = "System mode bitmap."]
14722 pub base_mode: MavModeFlag,
14723 #[doc = "System status flag."]
14724 pub system_status: MavState,
14725 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14726 pub mavlink_version: u8,
14727}
14728impl HEARTBEAT_DATA {
14729 pub const ENCODED_LEN: usize = 9usize;
14730 pub const DEFAULT: Self = Self {
14731 custom_mode: 0_u32,
14732 mavtype: MavType::DEFAULT,
14733 autopilot: MavAutopilot::DEFAULT,
14734 base_mode: MavModeFlag::DEFAULT,
14735 system_status: MavState::DEFAULT,
14736 mavlink_version: MINOR_MAVLINK_VERSION,
14737 };
14738 #[cfg(feature = "arbitrary")]
14739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14740 use arbitrary::{Arbitrary, Unstructured};
14741 let mut buf = [0u8; 1024];
14742 rng.fill_bytes(&mut buf);
14743 let mut unstructured = Unstructured::new(&buf);
14744 Self::arbitrary(&mut unstructured).unwrap_or_default()
14745 }
14746}
14747impl Default for HEARTBEAT_DATA {
14748 fn default() -> Self {
14749 Self::DEFAULT.clone()
14750 }
14751}
14752impl MessageData for HEARTBEAT_DATA {
14753 type Message = MavMessage;
14754 const ID: u32 = 0u32;
14755 const NAME: &'static str = "HEARTBEAT";
14756 const EXTRA_CRC: u8 = 50u8;
14757 const ENCODED_LEN: usize = 9usize;
14758 fn deser(
14759 _version: MavlinkVersion,
14760 __input: &[u8],
14761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14762 let avail_len = __input.len();
14763 let mut payload_buf = [0; Self::ENCODED_LEN];
14764 let mut buf = if avail_len < Self::ENCODED_LEN {
14765 payload_buf[0..avail_len].copy_from_slice(__input);
14766 Bytes::new(&payload_buf)
14767 } else {
14768 Bytes::new(__input)
14769 };
14770 let mut __struct = Self::default();
14771 __struct.custom_mode = buf.get_u32_le();
14772 let tmp = buf.get_u8();
14773 __struct.mavtype =
14774 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14775 enum_type: "MavType",
14776 value: tmp as u32,
14777 })?;
14778 let tmp = buf.get_u8();
14779 __struct.autopilot =
14780 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14781 enum_type: "MavAutopilot",
14782 value: tmp as u32,
14783 })?;
14784 let tmp = buf.get_u8();
14785 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14786 ::mavlink_core::error::ParserError::InvalidFlag {
14787 flag_type: "MavModeFlag",
14788 value: tmp as u32,
14789 },
14790 )?;
14791 let tmp = buf.get_u8();
14792 __struct.system_status =
14793 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14794 enum_type: "MavState",
14795 value: tmp as u32,
14796 })?;
14797 __struct.mavlink_version = buf.get_u8();
14798 Ok(__struct)
14799 }
14800 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14801 let mut __tmp = BytesMut::new(bytes);
14802 #[allow(clippy::absurd_extreme_comparisons)]
14803 #[allow(unused_comparisons)]
14804 if __tmp.remaining() < Self::ENCODED_LEN {
14805 panic!(
14806 "buffer is too small (need {} bytes, but got {})",
14807 Self::ENCODED_LEN,
14808 __tmp.remaining(),
14809 )
14810 }
14811 __tmp.put_u32_le(self.custom_mode);
14812 __tmp.put_u8(self.mavtype as u8);
14813 __tmp.put_u8(self.autopilot as u8);
14814 __tmp.put_u8(self.base_mode.bits());
14815 __tmp.put_u8(self.system_status as u8);
14816 __tmp.put_u8(self.mavlink_version);
14817 if matches!(version, MavlinkVersion::V2) {
14818 let len = __tmp.len();
14819 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14820 } else {
14821 __tmp.len()
14822 }
14823 }
14824}
14825#[doc = "id: 105"]
14826#[doc = "The IMU readings in SI units in NED body frame."]
14827#[derive(Debug, Clone, PartialEq)]
14828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14829#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14830pub struct HIGHRES_IMU_DATA {
14831 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14832 pub time_usec: u64,
14833 #[doc = "X acceleration"]
14834 pub xacc: f32,
14835 #[doc = "Y acceleration"]
14836 pub yacc: f32,
14837 #[doc = "Z acceleration"]
14838 pub zacc: f32,
14839 #[doc = "Angular speed around X axis"]
14840 pub xgyro: f32,
14841 #[doc = "Angular speed around Y axis"]
14842 pub ygyro: f32,
14843 #[doc = "Angular speed around Z axis"]
14844 pub zgyro: f32,
14845 #[doc = "X Magnetic field"]
14846 pub xmag: f32,
14847 #[doc = "Y Magnetic field"]
14848 pub ymag: f32,
14849 #[doc = "Z Magnetic field"]
14850 pub zmag: f32,
14851 #[doc = "Absolute pressure"]
14852 pub abs_pressure: f32,
14853 #[doc = "Differential pressure"]
14854 pub diff_pressure: f32,
14855 #[doc = "Altitude calculated from pressure"]
14856 pub pressure_alt: f32,
14857 #[doc = "Temperature"]
14858 pub temperature: f32,
14859 #[doc = "Bitmap for fields that have updated since last message"]
14860 pub fields_updated: HighresImuUpdatedFlags,
14861 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14862 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14863 pub id: u8,
14864}
14865impl HIGHRES_IMU_DATA {
14866 pub const ENCODED_LEN: usize = 63usize;
14867 pub const DEFAULT: Self = Self {
14868 time_usec: 0_u64,
14869 xacc: 0.0_f32,
14870 yacc: 0.0_f32,
14871 zacc: 0.0_f32,
14872 xgyro: 0.0_f32,
14873 ygyro: 0.0_f32,
14874 zgyro: 0.0_f32,
14875 xmag: 0.0_f32,
14876 ymag: 0.0_f32,
14877 zmag: 0.0_f32,
14878 abs_pressure: 0.0_f32,
14879 diff_pressure: 0.0_f32,
14880 pressure_alt: 0.0_f32,
14881 temperature: 0.0_f32,
14882 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14883 id: 0_u8,
14884 };
14885 #[cfg(feature = "arbitrary")]
14886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14887 use arbitrary::{Arbitrary, Unstructured};
14888 let mut buf = [0u8; 1024];
14889 rng.fill_bytes(&mut buf);
14890 let mut unstructured = Unstructured::new(&buf);
14891 Self::arbitrary(&mut unstructured).unwrap_or_default()
14892 }
14893}
14894impl Default for HIGHRES_IMU_DATA {
14895 fn default() -> Self {
14896 Self::DEFAULT.clone()
14897 }
14898}
14899impl MessageData for HIGHRES_IMU_DATA {
14900 type Message = MavMessage;
14901 const ID: u32 = 105u32;
14902 const NAME: &'static str = "HIGHRES_IMU";
14903 const EXTRA_CRC: u8 = 93u8;
14904 const ENCODED_LEN: usize = 63usize;
14905 fn deser(
14906 _version: MavlinkVersion,
14907 __input: &[u8],
14908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14909 let avail_len = __input.len();
14910 let mut payload_buf = [0; Self::ENCODED_LEN];
14911 let mut buf = if avail_len < Self::ENCODED_LEN {
14912 payload_buf[0..avail_len].copy_from_slice(__input);
14913 Bytes::new(&payload_buf)
14914 } else {
14915 Bytes::new(__input)
14916 };
14917 let mut __struct = Self::default();
14918 __struct.time_usec = buf.get_u64_le();
14919 __struct.xacc = buf.get_f32_le();
14920 __struct.yacc = buf.get_f32_le();
14921 __struct.zacc = buf.get_f32_le();
14922 __struct.xgyro = buf.get_f32_le();
14923 __struct.ygyro = buf.get_f32_le();
14924 __struct.zgyro = buf.get_f32_le();
14925 __struct.xmag = buf.get_f32_le();
14926 __struct.ymag = buf.get_f32_le();
14927 __struct.zmag = buf.get_f32_le();
14928 __struct.abs_pressure = buf.get_f32_le();
14929 __struct.diff_pressure = buf.get_f32_le();
14930 __struct.pressure_alt = buf.get_f32_le();
14931 __struct.temperature = buf.get_f32_le();
14932 let tmp = buf.get_u16_le();
14933 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14934 tmp & HighresImuUpdatedFlags::all().bits(),
14935 )
14936 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14937 flag_type: "HighresImuUpdatedFlags",
14938 value: tmp as u32,
14939 })?;
14940 __struct.id = buf.get_u8();
14941 Ok(__struct)
14942 }
14943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14944 let mut __tmp = BytesMut::new(bytes);
14945 #[allow(clippy::absurd_extreme_comparisons)]
14946 #[allow(unused_comparisons)]
14947 if __tmp.remaining() < Self::ENCODED_LEN {
14948 panic!(
14949 "buffer is too small (need {} bytes, but got {})",
14950 Self::ENCODED_LEN,
14951 __tmp.remaining(),
14952 )
14953 }
14954 __tmp.put_u64_le(self.time_usec);
14955 __tmp.put_f32_le(self.xacc);
14956 __tmp.put_f32_le(self.yacc);
14957 __tmp.put_f32_le(self.zacc);
14958 __tmp.put_f32_le(self.xgyro);
14959 __tmp.put_f32_le(self.ygyro);
14960 __tmp.put_f32_le(self.zgyro);
14961 __tmp.put_f32_le(self.xmag);
14962 __tmp.put_f32_le(self.ymag);
14963 __tmp.put_f32_le(self.zmag);
14964 __tmp.put_f32_le(self.abs_pressure);
14965 __tmp.put_f32_le(self.diff_pressure);
14966 __tmp.put_f32_le(self.pressure_alt);
14967 __tmp.put_f32_le(self.temperature);
14968 __tmp.put_u16_le(self.fields_updated.bits());
14969 __tmp.put_u8(self.id);
14970 if matches!(version, MavlinkVersion::V2) {
14971 let len = __tmp.len();
14972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14973 } else {
14974 __tmp.len()
14975 }
14976 }
14977}
14978#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
14979#[doc = "id: 234"]
14980#[doc = "Message appropriate for high latency connections like Iridium."]
14981#[derive(Debug, Clone, PartialEq)]
14982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14984pub struct HIGH_LATENCY_DATA {
14985 #[doc = "A bitfield for use for autopilot-specific flags."]
14986 pub custom_mode: u32,
14987 #[doc = "Latitude"]
14988 pub latitude: i32,
14989 #[doc = "Longitude"]
14990 pub longitude: i32,
14991 #[doc = "roll"]
14992 pub roll: i16,
14993 #[doc = "pitch"]
14994 pub pitch: i16,
14995 #[doc = "heading"]
14996 pub heading: u16,
14997 #[doc = "heading setpoint"]
14998 pub heading_sp: i16,
14999 #[doc = "Altitude above mean sea level"]
15000 pub altitude_amsl: i16,
15001 #[doc = "Altitude setpoint relative to the home position"]
15002 pub altitude_sp: i16,
15003 #[doc = "distance to target"]
15004 pub wp_distance: u16,
15005 #[doc = "Bitmap of enabled system modes."]
15006 pub base_mode: MavModeFlag,
15007 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15008 pub landed_state: MavLandedState,
15009 #[doc = "throttle (percentage)"]
15010 pub throttle: i8,
15011 #[doc = "airspeed"]
15012 pub airspeed: u8,
15013 #[doc = "airspeed setpoint"]
15014 pub airspeed_sp: u8,
15015 #[doc = "groundspeed"]
15016 pub groundspeed: u8,
15017 #[doc = "climb rate"]
15018 pub climb_rate: i8,
15019 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15020 pub gps_nsat: u8,
15021 #[doc = "GPS Fix type."]
15022 pub gps_fix_type: GpsFixType,
15023 #[doc = "Remaining battery (percentage)"]
15024 pub battery_remaining: u8,
15025 #[doc = "Autopilot temperature (degrees C)"]
15026 pub temperature: i8,
15027 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15028 pub temperature_air: i8,
15029 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15030 pub failsafe: u8,
15031 #[doc = "current waypoint number"]
15032 pub wp_num: u8,
15033}
15034impl HIGH_LATENCY_DATA {
15035 pub const ENCODED_LEN: usize = 40usize;
15036 pub const DEFAULT: Self = Self {
15037 custom_mode: 0_u32,
15038 latitude: 0_i32,
15039 longitude: 0_i32,
15040 roll: 0_i16,
15041 pitch: 0_i16,
15042 heading: 0_u16,
15043 heading_sp: 0_i16,
15044 altitude_amsl: 0_i16,
15045 altitude_sp: 0_i16,
15046 wp_distance: 0_u16,
15047 base_mode: MavModeFlag::DEFAULT,
15048 landed_state: MavLandedState::DEFAULT,
15049 throttle: 0_i8,
15050 airspeed: 0_u8,
15051 airspeed_sp: 0_u8,
15052 groundspeed: 0_u8,
15053 climb_rate: 0_i8,
15054 gps_nsat: 0_u8,
15055 gps_fix_type: GpsFixType::DEFAULT,
15056 battery_remaining: 0_u8,
15057 temperature: 0_i8,
15058 temperature_air: 0_i8,
15059 failsafe: 0_u8,
15060 wp_num: 0_u8,
15061 };
15062 #[cfg(feature = "arbitrary")]
15063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15064 use arbitrary::{Arbitrary, Unstructured};
15065 let mut buf = [0u8; 1024];
15066 rng.fill_bytes(&mut buf);
15067 let mut unstructured = Unstructured::new(&buf);
15068 Self::arbitrary(&mut unstructured).unwrap_or_default()
15069 }
15070}
15071impl Default for HIGH_LATENCY_DATA {
15072 fn default() -> Self {
15073 Self::DEFAULT.clone()
15074 }
15075}
15076impl MessageData for HIGH_LATENCY_DATA {
15077 type Message = MavMessage;
15078 const ID: u32 = 234u32;
15079 const NAME: &'static str = "HIGH_LATENCY";
15080 const EXTRA_CRC: u8 = 150u8;
15081 const ENCODED_LEN: usize = 40usize;
15082 fn deser(
15083 _version: MavlinkVersion,
15084 __input: &[u8],
15085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15086 let avail_len = __input.len();
15087 let mut payload_buf = [0; Self::ENCODED_LEN];
15088 let mut buf = if avail_len < Self::ENCODED_LEN {
15089 payload_buf[0..avail_len].copy_from_slice(__input);
15090 Bytes::new(&payload_buf)
15091 } else {
15092 Bytes::new(__input)
15093 };
15094 let mut __struct = Self::default();
15095 __struct.custom_mode = buf.get_u32_le();
15096 __struct.latitude = buf.get_i32_le();
15097 __struct.longitude = buf.get_i32_le();
15098 __struct.roll = buf.get_i16_le();
15099 __struct.pitch = buf.get_i16_le();
15100 __struct.heading = buf.get_u16_le();
15101 __struct.heading_sp = buf.get_i16_le();
15102 __struct.altitude_amsl = buf.get_i16_le();
15103 __struct.altitude_sp = buf.get_i16_le();
15104 __struct.wp_distance = buf.get_u16_le();
15105 let tmp = buf.get_u8();
15106 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15107 ::mavlink_core::error::ParserError::InvalidFlag {
15108 flag_type: "MavModeFlag",
15109 value: tmp as u32,
15110 },
15111 )?;
15112 let tmp = buf.get_u8();
15113 __struct.landed_state =
15114 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15115 enum_type: "MavLandedState",
15116 value: tmp as u32,
15117 })?;
15118 __struct.throttle = buf.get_i8();
15119 __struct.airspeed = buf.get_u8();
15120 __struct.airspeed_sp = buf.get_u8();
15121 __struct.groundspeed = buf.get_u8();
15122 __struct.climb_rate = buf.get_i8();
15123 __struct.gps_nsat = buf.get_u8();
15124 let tmp = buf.get_u8();
15125 __struct.gps_fix_type =
15126 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15127 enum_type: "GpsFixType",
15128 value: tmp as u32,
15129 })?;
15130 __struct.battery_remaining = buf.get_u8();
15131 __struct.temperature = buf.get_i8();
15132 __struct.temperature_air = buf.get_i8();
15133 __struct.failsafe = buf.get_u8();
15134 __struct.wp_num = buf.get_u8();
15135 Ok(__struct)
15136 }
15137 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15138 let mut __tmp = BytesMut::new(bytes);
15139 #[allow(clippy::absurd_extreme_comparisons)]
15140 #[allow(unused_comparisons)]
15141 if __tmp.remaining() < Self::ENCODED_LEN {
15142 panic!(
15143 "buffer is too small (need {} bytes, but got {})",
15144 Self::ENCODED_LEN,
15145 __tmp.remaining(),
15146 )
15147 }
15148 __tmp.put_u32_le(self.custom_mode);
15149 __tmp.put_i32_le(self.latitude);
15150 __tmp.put_i32_le(self.longitude);
15151 __tmp.put_i16_le(self.roll);
15152 __tmp.put_i16_le(self.pitch);
15153 __tmp.put_u16_le(self.heading);
15154 __tmp.put_i16_le(self.heading_sp);
15155 __tmp.put_i16_le(self.altitude_amsl);
15156 __tmp.put_i16_le(self.altitude_sp);
15157 __tmp.put_u16_le(self.wp_distance);
15158 __tmp.put_u8(self.base_mode.bits());
15159 __tmp.put_u8(self.landed_state as u8);
15160 __tmp.put_i8(self.throttle);
15161 __tmp.put_u8(self.airspeed);
15162 __tmp.put_u8(self.airspeed_sp);
15163 __tmp.put_u8(self.groundspeed);
15164 __tmp.put_i8(self.climb_rate);
15165 __tmp.put_u8(self.gps_nsat);
15166 __tmp.put_u8(self.gps_fix_type as u8);
15167 __tmp.put_u8(self.battery_remaining);
15168 __tmp.put_i8(self.temperature);
15169 __tmp.put_i8(self.temperature_air);
15170 __tmp.put_u8(self.failsafe);
15171 __tmp.put_u8(self.wp_num);
15172 if matches!(version, MavlinkVersion::V2) {
15173 let len = __tmp.len();
15174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15175 } else {
15176 __tmp.len()
15177 }
15178 }
15179}
15180#[doc = "id: 235"]
15181#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15182#[derive(Debug, Clone, PartialEq)]
15183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15185pub struct HIGH_LATENCY2_DATA {
15186 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15187 pub timestamp: u32,
15188 #[doc = "Latitude"]
15189 pub latitude: i32,
15190 #[doc = "Longitude"]
15191 pub longitude: i32,
15192 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15193 pub custom_mode: u16,
15194 #[doc = "Altitude above mean sea level"]
15195 pub altitude: i16,
15196 #[doc = "Altitude setpoint"]
15197 pub target_altitude: i16,
15198 #[doc = "Distance to target waypoint or position"]
15199 pub target_distance: u16,
15200 #[doc = "Current waypoint number"]
15201 pub wp_num: u16,
15202 #[doc = "Bitmap of failure flags."]
15203 pub failure_flags: HlFailureFlag,
15204 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15205 pub mavtype: MavType,
15206 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15207 pub autopilot: MavAutopilot,
15208 #[doc = "Heading"]
15209 pub heading: u8,
15210 #[doc = "Heading setpoint"]
15211 pub target_heading: u8,
15212 #[doc = "Throttle"]
15213 pub throttle: u8,
15214 #[doc = "Airspeed"]
15215 pub airspeed: u8,
15216 #[doc = "Airspeed setpoint"]
15217 pub airspeed_sp: u8,
15218 #[doc = "Groundspeed"]
15219 pub groundspeed: u8,
15220 #[doc = "Windspeed"]
15221 pub windspeed: u8,
15222 #[doc = "Wind heading"]
15223 pub wind_heading: u8,
15224 #[doc = "Maximum error horizontal position since last message"]
15225 pub eph: u8,
15226 #[doc = "Maximum error vertical position since last message"]
15227 pub epv: u8,
15228 #[doc = "Air temperature"]
15229 pub temperature_air: i8,
15230 #[doc = "Maximum climb rate magnitude since last message"]
15231 pub climb_rate: i8,
15232 #[doc = "Battery level (-1 if field not provided)."]
15233 pub battery: i8,
15234 #[doc = "Field for custom payload."]
15235 pub custom0: i8,
15236 #[doc = "Field for custom payload."]
15237 pub custom1: i8,
15238 #[doc = "Field for custom payload."]
15239 pub custom2: i8,
15240}
15241impl HIGH_LATENCY2_DATA {
15242 pub const ENCODED_LEN: usize = 42usize;
15243 pub const DEFAULT: Self = Self {
15244 timestamp: 0_u32,
15245 latitude: 0_i32,
15246 longitude: 0_i32,
15247 custom_mode: 0_u16,
15248 altitude: 0_i16,
15249 target_altitude: 0_i16,
15250 target_distance: 0_u16,
15251 wp_num: 0_u16,
15252 failure_flags: HlFailureFlag::DEFAULT,
15253 mavtype: MavType::DEFAULT,
15254 autopilot: MavAutopilot::DEFAULT,
15255 heading: 0_u8,
15256 target_heading: 0_u8,
15257 throttle: 0_u8,
15258 airspeed: 0_u8,
15259 airspeed_sp: 0_u8,
15260 groundspeed: 0_u8,
15261 windspeed: 0_u8,
15262 wind_heading: 0_u8,
15263 eph: 0_u8,
15264 epv: 0_u8,
15265 temperature_air: 0_i8,
15266 climb_rate: 0_i8,
15267 battery: 0_i8,
15268 custom0: 0_i8,
15269 custom1: 0_i8,
15270 custom2: 0_i8,
15271 };
15272 #[cfg(feature = "arbitrary")]
15273 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15274 use arbitrary::{Arbitrary, Unstructured};
15275 let mut buf = [0u8; 1024];
15276 rng.fill_bytes(&mut buf);
15277 let mut unstructured = Unstructured::new(&buf);
15278 Self::arbitrary(&mut unstructured).unwrap_or_default()
15279 }
15280}
15281impl Default for HIGH_LATENCY2_DATA {
15282 fn default() -> Self {
15283 Self::DEFAULT.clone()
15284 }
15285}
15286impl MessageData for HIGH_LATENCY2_DATA {
15287 type Message = MavMessage;
15288 const ID: u32 = 235u32;
15289 const NAME: &'static str = "HIGH_LATENCY2";
15290 const EXTRA_CRC: u8 = 179u8;
15291 const ENCODED_LEN: usize = 42usize;
15292 fn deser(
15293 _version: MavlinkVersion,
15294 __input: &[u8],
15295 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15296 let avail_len = __input.len();
15297 let mut payload_buf = [0; Self::ENCODED_LEN];
15298 let mut buf = if avail_len < Self::ENCODED_LEN {
15299 payload_buf[0..avail_len].copy_from_slice(__input);
15300 Bytes::new(&payload_buf)
15301 } else {
15302 Bytes::new(__input)
15303 };
15304 let mut __struct = Self::default();
15305 __struct.timestamp = buf.get_u32_le();
15306 __struct.latitude = buf.get_i32_le();
15307 __struct.longitude = buf.get_i32_le();
15308 __struct.custom_mode = buf.get_u16_le();
15309 __struct.altitude = buf.get_i16_le();
15310 __struct.target_altitude = buf.get_i16_le();
15311 __struct.target_distance = buf.get_u16_le();
15312 __struct.wp_num = buf.get_u16_le();
15313 let tmp = buf.get_u16_le();
15314 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15315 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15316 flag_type: "HlFailureFlag",
15317 value: tmp as u32,
15318 })?;
15319 let tmp = buf.get_u8();
15320 __struct.mavtype =
15321 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15322 enum_type: "MavType",
15323 value: tmp as u32,
15324 })?;
15325 let tmp = buf.get_u8();
15326 __struct.autopilot =
15327 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15328 enum_type: "MavAutopilot",
15329 value: tmp as u32,
15330 })?;
15331 __struct.heading = buf.get_u8();
15332 __struct.target_heading = buf.get_u8();
15333 __struct.throttle = buf.get_u8();
15334 __struct.airspeed = buf.get_u8();
15335 __struct.airspeed_sp = buf.get_u8();
15336 __struct.groundspeed = buf.get_u8();
15337 __struct.windspeed = buf.get_u8();
15338 __struct.wind_heading = buf.get_u8();
15339 __struct.eph = buf.get_u8();
15340 __struct.epv = buf.get_u8();
15341 __struct.temperature_air = buf.get_i8();
15342 __struct.climb_rate = buf.get_i8();
15343 __struct.battery = buf.get_i8();
15344 __struct.custom0 = buf.get_i8();
15345 __struct.custom1 = buf.get_i8();
15346 __struct.custom2 = buf.get_i8();
15347 Ok(__struct)
15348 }
15349 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15350 let mut __tmp = BytesMut::new(bytes);
15351 #[allow(clippy::absurd_extreme_comparisons)]
15352 #[allow(unused_comparisons)]
15353 if __tmp.remaining() < Self::ENCODED_LEN {
15354 panic!(
15355 "buffer is too small (need {} bytes, but got {})",
15356 Self::ENCODED_LEN,
15357 __tmp.remaining(),
15358 )
15359 }
15360 __tmp.put_u32_le(self.timestamp);
15361 __tmp.put_i32_le(self.latitude);
15362 __tmp.put_i32_le(self.longitude);
15363 __tmp.put_u16_le(self.custom_mode);
15364 __tmp.put_i16_le(self.altitude);
15365 __tmp.put_i16_le(self.target_altitude);
15366 __tmp.put_u16_le(self.target_distance);
15367 __tmp.put_u16_le(self.wp_num);
15368 __tmp.put_u16_le(self.failure_flags.bits());
15369 __tmp.put_u8(self.mavtype as u8);
15370 __tmp.put_u8(self.autopilot as u8);
15371 __tmp.put_u8(self.heading);
15372 __tmp.put_u8(self.target_heading);
15373 __tmp.put_u8(self.throttle);
15374 __tmp.put_u8(self.airspeed);
15375 __tmp.put_u8(self.airspeed_sp);
15376 __tmp.put_u8(self.groundspeed);
15377 __tmp.put_u8(self.windspeed);
15378 __tmp.put_u8(self.wind_heading);
15379 __tmp.put_u8(self.eph);
15380 __tmp.put_u8(self.epv);
15381 __tmp.put_i8(self.temperature_air);
15382 __tmp.put_i8(self.climb_rate);
15383 __tmp.put_i8(self.battery);
15384 __tmp.put_i8(self.custom0);
15385 __tmp.put_i8(self.custom1);
15386 __tmp.put_i8(self.custom2);
15387 if matches!(version, MavlinkVersion::V2) {
15388 let len = __tmp.len();
15389 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15390 } else {
15391 __tmp.len()
15392 }
15393 }
15394}
15395#[doc = "id: 93"]
15396#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15397#[derive(Debug, Clone, PartialEq)]
15398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15400pub struct HIL_ACTUATOR_CONTROLS_DATA {
15401 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15402 pub time_usec: u64,
15403 #[doc = "Flags bitmask."]
15404 pub flags: HilActuatorControlsFlags,
15405 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15406 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15407 pub controls: [f32; 16],
15408 #[doc = "System mode. Includes arming state."]
15409 pub mode: MavModeFlag,
15410}
15411impl HIL_ACTUATOR_CONTROLS_DATA {
15412 pub const ENCODED_LEN: usize = 81usize;
15413 pub const DEFAULT: Self = Self {
15414 time_usec: 0_u64,
15415 flags: HilActuatorControlsFlags::DEFAULT,
15416 controls: [0.0_f32; 16usize],
15417 mode: MavModeFlag::DEFAULT,
15418 };
15419 #[cfg(feature = "arbitrary")]
15420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15421 use arbitrary::{Arbitrary, Unstructured};
15422 let mut buf = [0u8; 1024];
15423 rng.fill_bytes(&mut buf);
15424 let mut unstructured = Unstructured::new(&buf);
15425 Self::arbitrary(&mut unstructured).unwrap_or_default()
15426 }
15427}
15428impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15429 fn default() -> Self {
15430 Self::DEFAULT.clone()
15431 }
15432}
15433impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15434 type Message = MavMessage;
15435 const ID: u32 = 93u32;
15436 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15437 const EXTRA_CRC: u8 = 47u8;
15438 const ENCODED_LEN: usize = 81usize;
15439 fn deser(
15440 _version: MavlinkVersion,
15441 __input: &[u8],
15442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15443 let avail_len = __input.len();
15444 let mut payload_buf = [0; Self::ENCODED_LEN];
15445 let mut buf = if avail_len < Self::ENCODED_LEN {
15446 payload_buf[0..avail_len].copy_from_slice(__input);
15447 Bytes::new(&payload_buf)
15448 } else {
15449 Bytes::new(__input)
15450 };
15451 let mut __struct = Self::default();
15452 __struct.time_usec = buf.get_u64_le();
15453 let tmp = buf.get_u64_le();
15454 __struct.flags =
15455 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15456 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15457 flag_type: "HilActuatorControlsFlags",
15458 value: tmp as u32,
15459 })?;
15460 for v in &mut __struct.controls {
15461 let val = buf.get_f32_le();
15462 *v = val;
15463 }
15464 let tmp = buf.get_u8();
15465 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15466 ::mavlink_core::error::ParserError::InvalidFlag {
15467 flag_type: "MavModeFlag",
15468 value: tmp as u32,
15469 },
15470 )?;
15471 Ok(__struct)
15472 }
15473 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15474 let mut __tmp = BytesMut::new(bytes);
15475 #[allow(clippy::absurd_extreme_comparisons)]
15476 #[allow(unused_comparisons)]
15477 if __tmp.remaining() < Self::ENCODED_LEN {
15478 panic!(
15479 "buffer is too small (need {} bytes, but got {})",
15480 Self::ENCODED_LEN,
15481 __tmp.remaining(),
15482 )
15483 }
15484 __tmp.put_u64_le(self.time_usec);
15485 __tmp.put_u64_le(self.flags.bits());
15486 for val in &self.controls {
15487 __tmp.put_f32_le(*val);
15488 }
15489 __tmp.put_u8(self.mode.bits());
15490 if matches!(version, MavlinkVersion::V2) {
15491 let len = __tmp.len();
15492 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15493 } else {
15494 __tmp.len()
15495 }
15496 }
15497}
15498#[doc = "id: 91"]
15499#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15500#[derive(Debug, Clone, PartialEq)]
15501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15503pub struct HIL_CONTROLS_DATA {
15504 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15505 pub time_usec: u64,
15506 #[doc = "Control output -1 .. 1"]
15507 pub roll_ailerons: f32,
15508 #[doc = "Control output -1 .. 1"]
15509 pub pitch_elevator: f32,
15510 #[doc = "Control output -1 .. 1"]
15511 pub yaw_rudder: f32,
15512 #[doc = "Throttle 0 .. 1"]
15513 pub throttle: f32,
15514 #[doc = "Aux 1, -1 .. 1"]
15515 pub aux1: f32,
15516 #[doc = "Aux 2, -1 .. 1"]
15517 pub aux2: f32,
15518 #[doc = "Aux 3, -1 .. 1"]
15519 pub aux3: f32,
15520 #[doc = "Aux 4, -1 .. 1"]
15521 pub aux4: f32,
15522 #[doc = "System mode."]
15523 pub mode: MavMode,
15524 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15525 pub nav_mode: u8,
15526}
15527impl HIL_CONTROLS_DATA {
15528 pub const ENCODED_LEN: usize = 42usize;
15529 pub const DEFAULT: Self = Self {
15530 time_usec: 0_u64,
15531 roll_ailerons: 0.0_f32,
15532 pitch_elevator: 0.0_f32,
15533 yaw_rudder: 0.0_f32,
15534 throttle: 0.0_f32,
15535 aux1: 0.0_f32,
15536 aux2: 0.0_f32,
15537 aux3: 0.0_f32,
15538 aux4: 0.0_f32,
15539 mode: MavMode::DEFAULT,
15540 nav_mode: 0_u8,
15541 };
15542 #[cfg(feature = "arbitrary")]
15543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15544 use arbitrary::{Arbitrary, Unstructured};
15545 let mut buf = [0u8; 1024];
15546 rng.fill_bytes(&mut buf);
15547 let mut unstructured = Unstructured::new(&buf);
15548 Self::arbitrary(&mut unstructured).unwrap_or_default()
15549 }
15550}
15551impl Default for HIL_CONTROLS_DATA {
15552 fn default() -> Self {
15553 Self::DEFAULT.clone()
15554 }
15555}
15556impl MessageData for HIL_CONTROLS_DATA {
15557 type Message = MavMessage;
15558 const ID: u32 = 91u32;
15559 const NAME: &'static str = "HIL_CONTROLS";
15560 const EXTRA_CRC: u8 = 63u8;
15561 const ENCODED_LEN: usize = 42usize;
15562 fn deser(
15563 _version: MavlinkVersion,
15564 __input: &[u8],
15565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15566 let avail_len = __input.len();
15567 let mut payload_buf = [0; Self::ENCODED_LEN];
15568 let mut buf = if avail_len < Self::ENCODED_LEN {
15569 payload_buf[0..avail_len].copy_from_slice(__input);
15570 Bytes::new(&payload_buf)
15571 } else {
15572 Bytes::new(__input)
15573 };
15574 let mut __struct = Self::default();
15575 __struct.time_usec = buf.get_u64_le();
15576 __struct.roll_ailerons = buf.get_f32_le();
15577 __struct.pitch_elevator = buf.get_f32_le();
15578 __struct.yaw_rudder = buf.get_f32_le();
15579 __struct.throttle = buf.get_f32_le();
15580 __struct.aux1 = buf.get_f32_le();
15581 __struct.aux2 = buf.get_f32_le();
15582 __struct.aux3 = buf.get_f32_le();
15583 __struct.aux4 = buf.get_f32_le();
15584 let tmp = buf.get_u8();
15585 __struct.mode =
15586 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15587 enum_type: "MavMode",
15588 value: tmp as u32,
15589 })?;
15590 __struct.nav_mode = buf.get_u8();
15591 Ok(__struct)
15592 }
15593 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15594 let mut __tmp = BytesMut::new(bytes);
15595 #[allow(clippy::absurd_extreme_comparisons)]
15596 #[allow(unused_comparisons)]
15597 if __tmp.remaining() < Self::ENCODED_LEN {
15598 panic!(
15599 "buffer is too small (need {} bytes, but got {})",
15600 Self::ENCODED_LEN,
15601 __tmp.remaining(),
15602 )
15603 }
15604 __tmp.put_u64_le(self.time_usec);
15605 __tmp.put_f32_le(self.roll_ailerons);
15606 __tmp.put_f32_le(self.pitch_elevator);
15607 __tmp.put_f32_le(self.yaw_rudder);
15608 __tmp.put_f32_le(self.throttle);
15609 __tmp.put_f32_le(self.aux1);
15610 __tmp.put_f32_le(self.aux2);
15611 __tmp.put_f32_le(self.aux3);
15612 __tmp.put_f32_le(self.aux4);
15613 __tmp.put_u8(self.mode as u8);
15614 __tmp.put_u8(self.nav_mode);
15615 if matches!(version, MavlinkVersion::V2) {
15616 let len = __tmp.len();
15617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15618 } else {
15619 __tmp.len()
15620 }
15621 }
15622}
15623#[doc = "id: 113"]
15624#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15625#[derive(Debug, Clone, PartialEq)]
15626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15628pub struct HIL_GPS_DATA {
15629 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15630 pub time_usec: u64,
15631 #[doc = "Latitude (WGS84)"]
15632 pub lat: i32,
15633 #[doc = "Longitude (WGS84)"]
15634 pub lon: i32,
15635 #[doc = "Altitude (MSL). Positive for up."]
15636 pub alt: i32,
15637 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15638 pub eph: u16,
15639 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15640 pub epv: u16,
15641 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15642 pub vel: u16,
15643 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15644 pub vn: i16,
15645 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15646 pub ve: i16,
15647 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15648 pub vd: i16,
15649 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15650 pub cog: u16,
15651 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15652 pub fix_type: u8,
15653 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15654 pub satellites_visible: u8,
15655 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15656 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15657 pub id: u8,
15658 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15660 pub yaw: u16,
15661}
15662impl HIL_GPS_DATA {
15663 pub const ENCODED_LEN: usize = 39usize;
15664 pub const DEFAULT: Self = Self {
15665 time_usec: 0_u64,
15666 lat: 0_i32,
15667 lon: 0_i32,
15668 alt: 0_i32,
15669 eph: 0_u16,
15670 epv: 0_u16,
15671 vel: 0_u16,
15672 vn: 0_i16,
15673 ve: 0_i16,
15674 vd: 0_i16,
15675 cog: 0_u16,
15676 fix_type: 0_u8,
15677 satellites_visible: 0_u8,
15678 id: 0_u8,
15679 yaw: 0_u16,
15680 };
15681 #[cfg(feature = "arbitrary")]
15682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15683 use arbitrary::{Arbitrary, Unstructured};
15684 let mut buf = [0u8; 1024];
15685 rng.fill_bytes(&mut buf);
15686 let mut unstructured = Unstructured::new(&buf);
15687 Self::arbitrary(&mut unstructured).unwrap_or_default()
15688 }
15689}
15690impl Default for HIL_GPS_DATA {
15691 fn default() -> Self {
15692 Self::DEFAULT.clone()
15693 }
15694}
15695impl MessageData for HIL_GPS_DATA {
15696 type Message = MavMessage;
15697 const ID: u32 = 113u32;
15698 const NAME: &'static str = "HIL_GPS";
15699 const EXTRA_CRC: u8 = 124u8;
15700 const ENCODED_LEN: usize = 39usize;
15701 fn deser(
15702 _version: MavlinkVersion,
15703 __input: &[u8],
15704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15705 let avail_len = __input.len();
15706 let mut payload_buf = [0; Self::ENCODED_LEN];
15707 let mut buf = if avail_len < Self::ENCODED_LEN {
15708 payload_buf[0..avail_len].copy_from_slice(__input);
15709 Bytes::new(&payload_buf)
15710 } else {
15711 Bytes::new(__input)
15712 };
15713 let mut __struct = Self::default();
15714 __struct.time_usec = buf.get_u64_le();
15715 __struct.lat = buf.get_i32_le();
15716 __struct.lon = buf.get_i32_le();
15717 __struct.alt = buf.get_i32_le();
15718 __struct.eph = buf.get_u16_le();
15719 __struct.epv = buf.get_u16_le();
15720 __struct.vel = buf.get_u16_le();
15721 __struct.vn = buf.get_i16_le();
15722 __struct.ve = buf.get_i16_le();
15723 __struct.vd = buf.get_i16_le();
15724 __struct.cog = buf.get_u16_le();
15725 __struct.fix_type = buf.get_u8();
15726 __struct.satellites_visible = buf.get_u8();
15727 __struct.id = buf.get_u8();
15728 __struct.yaw = buf.get_u16_le();
15729 Ok(__struct)
15730 }
15731 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15732 let mut __tmp = BytesMut::new(bytes);
15733 #[allow(clippy::absurd_extreme_comparisons)]
15734 #[allow(unused_comparisons)]
15735 if __tmp.remaining() < Self::ENCODED_LEN {
15736 panic!(
15737 "buffer is too small (need {} bytes, but got {})",
15738 Self::ENCODED_LEN,
15739 __tmp.remaining(),
15740 )
15741 }
15742 __tmp.put_u64_le(self.time_usec);
15743 __tmp.put_i32_le(self.lat);
15744 __tmp.put_i32_le(self.lon);
15745 __tmp.put_i32_le(self.alt);
15746 __tmp.put_u16_le(self.eph);
15747 __tmp.put_u16_le(self.epv);
15748 __tmp.put_u16_le(self.vel);
15749 __tmp.put_i16_le(self.vn);
15750 __tmp.put_i16_le(self.ve);
15751 __tmp.put_i16_le(self.vd);
15752 __tmp.put_u16_le(self.cog);
15753 __tmp.put_u8(self.fix_type);
15754 __tmp.put_u8(self.satellites_visible);
15755 __tmp.put_u8(self.id);
15756 __tmp.put_u16_le(self.yaw);
15757 if matches!(version, MavlinkVersion::V2) {
15758 let len = __tmp.len();
15759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15760 } else {
15761 __tmp.len()
15762 }
15763 }
15764}
15765#[doc = "id: 114"]
15766#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15767#[derive(Debug, Clone, PartialEq)]
15768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15770pub struct HIL_OPTICAL_FLOW_DATA {
15771 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15772 pub time_usec: u64,
15773 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15774 pub integration_time_us: u32,
15775 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15776 pub integrated_x: f32,
15777 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15778 pub integrated_y: f32,
15779 #[doc = "RH rotation around X axis"]
15780 pub integrated_xgyro: f32,
15781 #[doc = "RH rotation around Y axis"]
15782 pub integrated_ygyro: f32,
15783 #[doc = "RH rotation around Z axis"]
15784 pub integrated_zgyro: f32,
15785 #[doc = "Time since the distance was sampled."]
15786 pub time_delta_distance_us: u32,
15787 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15788 pub distance: f32,
15789 #[doc = "Temperature"]
15790 pub temperature: i16,
15791 #[doc = "Sensor ID"]
15792 pub sensor_id: u8,
15793 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15794 pub quality: u8,
15795}
15796impl HIL_OPTICAL_FLOW_DATA {
15797 pub const ENCODED_LEN: usize = 44usize;
15798 pub const DEFAULT: Self = Self {
15799 time_usec: 0_u64,
15800 integration_time_us: 0_u32,
15801 integrated_x: 0.0_f32,
15802 integrated_y: 0.0_f32,
15803 integrated_xgyro: 0.0_f32,
15804 integrated_ygyro: 0.0_f32,
15805 integrated_zgyro: 0.0_f32,
15806 time_delta_distance_us: 0_u32,
15807 distance: 0.0_f32,
15808 temperature: 0_i16,
15809 sensor_id: 0_u8,
15810 quality: 0_u8,
15811 };
15812 #[cfg(feature = "arbitrary")]
15813 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15814 use arbitrary::{Arbitrary, Unstructured};
15815 let mut buf = [0u8; 1024];
15816 rng.fill_bytes(&mut buf);
15817 let mut unstructured = Unstructured::new(&buf);
15818 Self::arbitrary(&mut unstructured).unwrap_or_default()
15819 }
15820}
15821impl Default for HIL_OPTICAL_FLOW_DATA {
15822 fn default() -> Self {
15823 Self::DEFAULT.clone()
15824 }
15825}
15826impl MessageData for HIL_OPTICAL_FLOW_DATA {
15827 type Message = MavMessage;
15828 const ID: u32 = 114u32;
15829 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15830 const EXTRA_CRC: u8 = 237u8;
15831 const ENCODED_LEN: usize = 44usize;
15832 fn deser(
15833 _version: MavlinkVersion,
15834 __input: &[u8],
15835 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15836 let avail_len = __input.len();
15837 let mut payload_buf = [0; Self::ENCODED_LEN];
15838 let mut buf = if avail_len < Self::ENCODED_LEN {
15839 payload_buf[0..avail_len].copy_from_slice(__input);
15840 Bytes::new(&payload_buf)
15841 } else {
15842 Bytes::new(__input)
15843 };
15844 let mut __struct = Self::default();
15845 __struct.time_usec = buf.get_u64_le();
15846 __struct.integration_time_us = buf.get_u32_le();
15847 __struct.integrated_x = buf.get_f32_le();
15848 __struct.integrated_y = buf.get_f32_le();
15849 __struct.integrated_xgyro = buf.get_f32_le();
15850 __struct.integrated_ygyro = buf.get_f32_le();
15851 __struct.integrated_zgyro = buf.get_f32_le();
15852 __struct.time_delta_distance_us = buf.get_u32_le();
15853 __struct.distance = buf.get_f32_le();
15854 __struct.temperature = buf.get_i16_le();
15855 __struct.sensor_id = buf.get_u8();
15856 __struct.quality = buf.get_u8();
15857 Ok(__struct)
15858 }
15859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15860 let mut __tmp = BytesMut::new(bytes);
15861 #[allow(clippy::absurd_extreme_comparisons)]
15862 #[allow(unused_comparisons)]
15863 if __tmp.remaining() < Self::ENCODED_LEN {
15864 panic!(
15865 "buffer is too small (need {} bytes, but got {})",
15866 Self::ENCODED_LEN,
15867 __tmp.remaining(),
15868 )
15869 }
15870 __tmp.put_u64_le(self.time_usec);
15871 __tmp.put_u32_le(self.integration_time_us);
15872 __tmp.put_f32_le(self.integrated_x);
15873 __tmp.put_f32_le(self.integrated_y);
15874 __tmp.put_f32_le(self.integrated_xgyro);
15875 __tmp.put_f32_le(self.integrated_ygyro);
15876 __tmp.put_f32_le(self.integrated_zgyro);
15877 __tmp.put_u32_le(self.time_delta_distance_us);
15878 __tmp.put_f32_le(self.distance);
15879 __tmp.put_i16_le(self.temperature);
15880 __tmp.put_u8(self.sensor_id);
15881 __tmp.put_u8(self.quality);
15882 if matches!(version, MavlinkVersion::V2) {
15883 let len = __tmp.len();
15884 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15885 } else {
15886 __tmp.len()
15887 }
15888 }
15889}
15890#[doc = "id: 92"]
15891#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15892#[derive(Debug, Clone, PartialEq)]
15893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15895pub struct HIL_RC_INPUTS_RAW_DATA {
15896 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15897 pub time_usec: u64,
15898 #[doc = "RC channel 1 value"]
15899 pub chan1_raw: u16,
15900 #[doc = "RC channel 2 value"]
15901 pub chan2_raw: u16,
15902 #[doc = "RC channel 3 value"]
15903 pub chan3_raw: u16,
15904 #[doc = "RC channel 4 value"]
15905 pub chan4_raw: u16,
15906 #[doc = "RC channel 5 value"]
15907 pub chan5_raw: u16,
15908 #[doc = "RC channel 6 value"]
15909 pub chan6_raw: u16,
15910 #[doc = "RC channel 7 value"]
15911 pub chan7_raw: u16,
15912 #[doc = "RC channel 8 value"]
15913 pub chan8_raw: u16,
15914 #[doc = "RC channel 9 value"]
15915 pub chan9_raw: u16,
15916 #[doc = "RC channel 10 value"]
15917 pub chan10_raw: u16,
15918 #[doc = "RC channel 11 value"]
15919 pub chan11_raw: u16,
15920 #[doc = "RC channel 12 value"]
15921 pub chan12_raw: u16,
15922 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15923 pub rssi: u8,
15924}
15925impl HIL_RC_INPUTS_RAW_DATA {
15926 pub const ENCODED_LEN: usize = 33usize;
15927 pub const DEFAULT: Self = Self {
15928 time_usec: 0_u64,
15929 chan1_raw: 0_u16,
15930 chan2_raw: 0_u16,
15931 chan3_raw: 0_u16,
15932 chan4_raw: 0_u16,
15933 chan5_raw: 0_u16,
15934 chan6_raw: 0_u16,
15935 chan7_raw: 0_u16,
15936 chan8_raw: 0_u16,
15937 chan9_raw: 0_u16,
15938 chan10_raw: 0_u16,
15939 chan11_raw: 0_u16,
15940 chan12_raw: 0_u16,
15941 rssi: 0_u8,
15942 };
15943 #[cfg(feature = "arbitrary")]
15944 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15945 use arbitrary::{Arbitrary, Unstructured};
15946 let mut buf = [0u8; 1024];
15947 rng.fill_bytes(&mut buf);
15948 let mut unstructured = Unstructured::new(&buf);
15949 Self::arbitrary(&mut unstructured).unwrap_or_default()
15950 }
15951}
15952impl Default for HIL_RC_INPUTS_RAW_DATA {
15953 fn default() -> Self {
15954 Self::DEFAULT.clone()
15955 }
15956}
15957impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15958 type Message = MavMessage;
15959 const ID: u32 = 92u32;
15960 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15961 const EXTRA_CRC: u8 = 54u8;
15962 const ENCODED_LEN: usize = 33usize;
15963 fn deser(
15964 _version: MavlinkVersion,
15965 __input: &[u8],
15966 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15967 let avail_len = __input.len();
15968 let mut payload_buf = [0; Self::ENCODED_LEN];
15969 let mut buf = if avail_len < Self::ENCODED_LEN {
15970 payload_buf[0..avail_len].copy_from_slice(__input);
15971 Bytes::new(&payload_buf)
15972 } else {
15973 Bytes::new(__input)
15974 };
15975 let mut __struct = Self::default();
15976 __struct.time_usec = buf.get_u64_le();
15977 __struct.chan1_raw = buf.get_u16_le();
15978 __struct.chan2_raw = buf.get_u16_le();
15979 __struct.chan3_raw = buf.get_u16_le();
15980 __struct.chan4_raw = buf.get_u16_le();
15981 __struct.chan5_raw = buf.get_u16_le();
15982 __struct.chan6_raw = buf.get_u16_le();
15983 __struct.chan7_raw = buf.get_u16_le();
15984 __struct.chan8_raw = buf.get_u16_le();
15985 __struct.chan9_raw = buf.get_u16_le();
15986 __struct.chan10_raw = buf.get_u16_le();
15987 __struct.chan11_raw = buf.get_u16_le();
15988 __struct.chan12_raw = buf.get_u16_le();
15989 __struct.rssi = buf.get_u8();
15990 Ok(__struct)
15991 }
15992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15993 let mut __tmp = BytesMut::new(bytes);
15994 #[allow(clippy::absurd_extreme_comparisons)]
15995 #[allow(unused_comparisons)]
15996 if __tmp.remaining() < Self::ENCODED_LEN {
15997 panic!(
15998 "buffer is too small (need {} bytes, but got {})",
15999 Self::ENCODED_LEN,
16000 __tmp.remaining(),
16001 )
16002 }
16003 __tmp.put_u64_le(self.time_usec);
16004 __tmp.put_u16_le(self.chan1_raw);
16005 __tmp.put_u16_le(self.chan2_raw);
16006 __tmp.put_u16_le(self.chan3_raw);
16007 __tmp.put_u16_le(self.chan4_raw);
16008 __tmp.put_u16_le(self.chan5_raw);
16009 __tmp.put_u16_le(self.chan6_raw);
16010 __tmp.put_u16_le(self.chan7_raw);
16011 __tmp.put_u16_le(self.chan8_raw);
16012 __tmp.put_u16_le(self.chan9_raw);
16013 __tmp.put_u16_le(self.chan10_raw);
16014 __tmp.put_u16_le(self.chan11_raw);
16015 __tmp.put_u16_le(self.chan12_raw);
16016 __tmp.put_u8(self.rssi);
16017 if matches!(version, MavlinkVersion::V2) {
16018 let len = __tmp.len();
16019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16020 } else {
16021 __tmp.len()
16022 }
16023 }
16024}
16025#[doc = "id: 107"]
16026#[doc = "The IMU readings in SI units in NED body frame."]
16027#[derive(Debug, Clone, PartialEq)]
16028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16030pub struct HIL_SENSOR_DATA {
16031 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16032 pub time_usec: u64,
16033 #[doc = "X acceleration"]
16034 pub xacc: f32,
16035 #[doc = "Y acceleration"]
16036 pub yacc: f32,
16037 #[doc = "Z acceleration"]
16038 pub zacc: f32,
16039 #[doc = "Angular speed around X axis in body frame"]
16040 pub xgyro: f32,
16041 #[doc = "Angular speed around Y axis in body frame"]
16042 pub ygyro: f32,
16043 #[doc = "Angular speed around Z axis in body frame"]
16044 pub zgyro: f32,
16045 #[doc = "X Magnetic field"]
16046 pub xmag: f32,
16047 #[doc = "Y Magnetic field"]
16048 pub ymag: f32,
16049 #[doc = "Z Magnetic field"]
16050 pub zmag: f32,
16051 #[doc = "Absolute pressure"]
16052 pub abs_pressure: f32,
16053 #[doc = "Differential pressure (airspeed)"]
16054 pub diff_pressure: f32,
16055 #[doc = "Altitude calculated from pressure"]
16056 pub pressure_alt: f32,
16057 #[doc = "Temperature"]
16058 pub temperature: f32,
16059 #[doc = "Bitmap for fields that have updated since last message"]
16060 pub fields_updated: HilSensorUpdatedFlags,
16061 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16062 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16063 pub id: u8,
16064}
16065impl HIL_SENSOR_DATA {
16066 pub const ENCODED_LEN: usize = 65usize;
16067 pub const DEFAULT: Self = Self {
16068 time_usec: 0_u64,
16069 xacc: 0.0_f32,
16070 yacc: 0.0_f32,
16071 zacc: 0.0_f32,
16072 xgyro: 0.0_f32,
16073 ygyro: 0.0_f32,
16074 zgyro: 0.0_f32,
16075 xmag: 0.0_f32,
16076 ymag: 0.0_f32,
16077 zmag: 0.0_f32,
16078 abs_pressure: 0.0_f32,
16079 diff_pressure: 0.0_f32,
16080 pressure_alt: 0.0_f32,
16081 temperature: 0.0_f32,
16082 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16083 id: 0_u8,
16084 };
16085 #[cfg(feature = "arbitrary")]
16086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16087 use arbitrary::{Arbitrary, Unstructured};
16088 let mut buf = [0u8; 1024];
16089 rng.fill_bytes(&mut buf);
16090 let mut unstructured = Unstructured::new(&buf);
16091 Self::arbitrary(&mut unstructured).unwrap_or_default()
16092 }
16093}
16094impl Default for HIL_SENSOR_DATA {
16095 fn default() -> Self {
16096 Self::DEFAULT.clone()
16097 }
16098}
16099impl MessageData for HIL_SENSOR_DATA {
16100 type Message = MavMessage;
16101 const ID: u32 = 107u32;
16102 const NAME: &'static str = "HIL_SENSOR";
16103 const EXTRA_CRC: u8 = 108u8;
16104 const ENCODED_LEN: usize = 65usize;
16105 fn deser(
16106 _version: MavlinkVersion,
16107 __input: &[u8],
16108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16109 let avail_len = __input.len();
16110 let mut payload_buf = [0; Self::ENCODED_LEN];
16111 let mut buf = if avail_len < Self::ENCODED_LEN {
16112 payload_buf[0..avail_len].copy_from_slice(__input);
16113 Bytes::new(&payload_buf)
16114 } else {
16115 Bytes::new(__input)
16116 };
16117 let mut __struct = Self::default();
16118 __struct.time_usec = buf.get_u64_le();
16119 __struct.xacc = buf.get_f32_le();
16120 __struct.yacc = buf.get_f32_le();
16121 __struct.zacc = buf.get_f32_le();
16122 __struct.xgyro = buf.get_f32_le();
16123 __struct.ygyro = buf.get_f32_le();
16124 __struct.zgyro = buf.get_f32_le();
16125 __struct.xmag = buf.get_f32_le();
16126 __struct.ymag = buf.get_f32_le();
16127 __struct.zmag = buf.get_f32_le();
16128 __struct.abs_pressure = buf.get_f32_le();
16129 __struct.diff_pressure = buf.get_f32_le();
16130 __struct.pressure_alt = buf.get_f32_le();
16131 __struct.temperature = buf.get_f32_le();
16132 let tmp = buf.get_u32_le();
16133 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16134 tmp & HilSensorUpdatedFlags::all().bits(),
16135 )
16136 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16137 flag_type: "HilSensorUpdatedFlags",
16138 value: tmp as u32,
16139 })?;
16140 __struct.id = buf.get_u8();
16141 Ok(__struct)
16142 }
16143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16144 let mut __tmp = BytesMut::new(bytes);
16145 #[allow(clippy::absurd_extreme_comparisons)]
16146 #[allow(unused_comparisons)]
16147 if __tmp.remaining() < Self::ENCODED_LEN {
16148 panic!(
16149 "buffer is too small (need {} bytes, but got {})",
16150 Self::ENCODED_LEN,
16151 __tmp.remaining(),
16152 )
16153 }
16154 __tmp.put_u64_le(self.time_usec);
16155 __tmp.put_f32_le(self.xacc);
16156 __tmp.put_f32_le(self.yacc);
16157 __tmp.put_f32_le(self.zacc);
16158 __tmp.put_f32_le(self.xgyro);
16159 __tmp.put_f32_le(self.ygyro);
16160 __tmp.put_f32_le(self.zgyro);
16161 __tmp.put_f32_le(self.xmag);
16162 __tmp.put_f32_le(self.ymag);
16163 __tmp.put_f32_le(self.zmag);
16164 __tmp.put_f32_le(self.abs_pressure);
16165 __tmp.put_f32_le(self.diff_pressure);
16166 __tmp.put_f32_le(self.pressure_alt);
16167 __tmp.put_f32_le(self.temperature);
16168 __tmp.put_u32_le(self.fields_updated.bits());
16169 __tmp.put_u8(self.id);
16170 if matches!(version, MavlinkVersion::V2) {
16171 let len = __tmp.len();
16172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16173 } else {
16174 __tmp.len()
16175 }
16176 }
16177}
16178#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16179#[doc = "id: 90"]
16180#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16181#[derive(Debug, Clone, PartialEq)]
16182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16184pub struct HIL_STATE_DATA {
16185 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16186 pub time_usec: u64,
16187 #[doc = "Roll angle"]
16188 pub roll: f32,
16189 #[doc = "Pitch angle"]
16190 pub pitch: f32,
16191 #[doc = "Yaw angle"]
16192 pub yaw: f32,
16193 #[doc = "Body frame roll / phi angular speed"]
16194 pub rollspeed: f32,
16195 #[doc = "Body frame pitch / theta angular speed"]
16196 pub pitchspeed: f32,
16197 #[doc = "Body frame yaw / psi angular speed"]
16198 pub yawspeed: f32,
16199 #[doc = "Latitude"]
16200 pub lat: i32,
16201 #[doc = "Longitude"]
16202 pub lon: i32,
16203 #[doc = "Altitude"]
16204 pub alt: i32,
16205 #[doc = "Ground X Speed (Latitude)"]
16206 pub vx: i16,
16207 #[doc = "Ground Y Speed (Longitude)"]
16208 pub vy: i16,
16209 #[doc = "Ground Z Speed (Altitude)"]
16210 pub vz: i16,
16211 #[doc = "X acceleration"]
16212 pub xacc: i16,
16213 #[doc = "Y acceleration"]
16214 pub yacc: i16,
16215 #[doc = "Z acceleration"]
16216 pub zacc: i16,
16217}
16218impl HIL_STATE_DATA {
16219 pub const ENCODED_LEN: usize = 56usize;
16220 pub const DEFAULT: Self = Self {
16221 time_usec: 0_u64,
16222 roll: 0.0_f32,
16223 pitch: 0.0_f32,
16224 yaw: 0.0_f32,
16225 rollspeed: 0.0_f32,
16226 pitchspeed: 0.0_f32,
16227 yawspeed: 0.0_f32,
16228 lat: 0_i32,
16229 lon: 0_i32,
16230 alt: 0_i32,
16231 vx: 0_i16,
16232 vy: 0_i16,
16233 vz: 0_i16,
16234 xacc: 0_i16,
16235 yacc: 0_i16,
16236 zacc: 0_i16,
16237 };
16238 #[cfg(feature = "arbitrary")]
16239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16240 use arbitrary::{Arbitrary, Unstructured};
16241 let mut buf = [0u8; 1024];
16242 rng.fill_bytes(&mut buf);
16243 let mut unstructured = Unstructured::new(&buf);
16244 Self::arbitrary(&mut unstructured).unwrap_or_default()
16245 }
16246}
16247impl Default for HIL_STATE_DATA {
16248 fn default() -> Self {
16249 Self::DEFAULT.clone()
16250 }
16251}
16252impl MessageData for HIL_STATE_DATA {
16253 type Message = MavMessage;
16254 const ID: u32 = 90u32;
16255 const NAME: &'static str = "HIL_STATE";
16256 const EXTRA_CRC: u8 = 183u8;
16257 const ENCODED_LEN: usize = 56usize;
16258 fn deser(
16259 _version: MavlinkVersion,
16260 __input: &[u8],
16261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16262 let avail_len = __input.len();
16263 let mut payload_buf = [0; Self::ENCODED_LEN];
16264 let mut buf = if avail_len < Self::ENCODED_LEN {
16265 payload_buf[0..avail_len].copy_from_slice(__input);
16266 Bytes::new(&payload_buf)
16267 } else {
16268 Bytes::new(__input)
16269 };
16270 let mut __struct = Self::default();
16271 __struct.time_usec = buf.get_u64_le();
16272 __struct.roll = buf.get_f32_le();
16273 __struct.pitch = buf.get_f32_le();
16274 __struct.yaw = buf.get_f32_le();
16275 __struct.rollspeed = buf.get_f32_le();
16276 __struct.pitchspeed = buf.get_f32_le();
16277 __struct.yawspeed = buf.get_f32_le();
16278 __struct.lat = buf.get_i32_le();
16279 __struct.lon = buf.get_i32_le();
16280 __struct.alt = buf.get_i32_le();
16281 __struct.vx = buf.get_i16_le();
16282 __struct.vy = buf.get_i16_le();
16283 __struct.vz = buf.get_i16_le();
16284 __struct.xacc = buf.get_i16_le();
16285 __struct.yacc = buf.get_i16_le();
16286 __struct.zacc = buf.get_i16_le();
16287 Ok(__struct)
16288 }
16289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16290 let mut __tmp = BytesMut::new(bytes);
16291 #[allow(clippy::absurd_extreme_comparisons)]
16292 #[allow(unused_comparisons)]
16293 if __tmp.remaining() < Self::ENCODED_LEN {
16294 panic!(
16295 "buffer is too small (need {} bytes, but got {})",
16296 Self::ENCODED_LEN,
16297 __tmp.remaining(),
16298 )
16299 }
16300 __tmp.put_u64_le(self.time_usec);
16301 __tmp.put_f32_le(self.roll);
16302 __tmp.put_f32_le(self.pitch);
16303 __tmp.put_f32_le(self.yaw);
16304 __tmp.put_f32_le(self.rollspeed);
16305 __tmp.put_f32_le(self.pitchspeed);
16306 __tmp.put_f32_le(self.yawspeed);
16307 __tmp.put_i32_le(self.lat);
16308 __tmp.put_i32_le(self.lon);
16309 __tmp.put_i32_le(self.alt);
16310 __tmp.put_i16_le(self.vx);
16311 __tmp.put_i16_le(self.vy);
16312 __tmp.put_i16_le(self.vz);
16313 __tmp.put_i16_le(self.xacc);
16314 __tmp.put_i16_le(self.yacc);
16315 __tmp.put_i16_le(self.zacc);
16316 if matches!(version, MavlinkVersion::V2) {
16317 let len = __tmp.len();
16318 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16319 } else {
16320 __tmp.len()
16321 }
16322 }
16323}
16324#[doc = "id: 115"]
16325#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16326#[derive(Debug, Clone, PartialEq)]
16327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16329pub struct HIL_STATE_QUATERNION_DATA {
16330 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16331 pub time_usec: u64,
16332 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16333 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16334 pub attitude_quaternion: [f32; 4],
16335 #[doc = "Body frame roll / phi angular speed"]
16336 pub rollspeed: f32,
16337 #[doc = "Body frame pitch / theta angular speed"]
16338 pub pitchspeed: f32,
16339 #[doc = "Body frame yaw / psi angular speed"]
16340 pub yawspeed: f32,
16341 #[doc = "Latitude"]
16342 pub lat: i32,
16343 #[doc = "Longitude"]
16344 pub lon: i32,
16345 #[doc = "Altitude"]
16346 pub alt: i32,
16347 #[doc = "Ground X Speed (Latitude)"]
16348 pub vx: i16,
16349 #[doc = "Ground Y Speed (Longitude)"]
16350 pub vy: i16,
16351 #[doc = "Ground Z Speed (Altitude)"]
16352 pub vz: i16,
16353 #[doc = "Indicated airspeed"]
16354 pub ind_airspeed: u16,
16355 #[doc = "True airspeed"]
16356 pub true_airspeed: u16,
16357 #[doc = "X acceleration"]
16358 pub xacc: i16,
16359 #[doc = "Y acceleration"]
16360 pub yacc: i16,
16361 #[doc = "Z acceleration"]
16362 pub zacc: i16,
16363}
16364impl HIL_STATE_QUATERNION_DATA {
16365 pub const ENCODED_LEN: usize = 64usize;
16366 pub const DEFAULT: Self = Self {
16367 time_usec: 0_u64,
16368 attitude_quaternion: [0.0_f32; 4usize],
16369 rollspeed: 0.0_f32,
16370 pitchspeed: 0.0_f32,
16371 yawspeed: 0.0_f32,
16372 lat: 0_i32,
16373 lon: 0_i32,
16374 alt: 0_i32,
16375 vx: 0_i16,
16376 vy: 0_i16,
16377 vz: 0_i16,
16378 ind_airspeed: 0_u16,
16379 true_airspeed: 0_u16,
16380 xacc: 0_i16,
16381 yacc: 0_i16,
16382 zacc: 0_i16,
16383 };
16384 #[cfg(feature = "arbitrary")]
16385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16386 use arbitrary::{Arbitrary, Unstructured};
16387 let mut buf = [0u8; 1024];
16388 rng.fill_bytes(&mut buf);
16389 let mut unstructured = Unstructured::new(&buf);
16390 Self::arbitrary(&mut unstructured).unwrap_or_default()
16391 }
16392}
16393impl Default for HIL_STATE_QUATERNION_DATA {
16394 fn default() -> Self {
16395 Self::DEFAULT.clone()
16396 }
16397}
16398impl MessageData for HIL_STATE_QUATERNION_DATA {
16399 type Message = MavMessage;
16400 const ID: u32 = 115u32;
16401 const NAME: &'static str = "HIL_STATE_QUATERNION";
16402 const EXTRA_CRC: u8 = 4u8;
16403 const ENCODED_LEN: usize = 64usize;
16404 fn deser(
16405 _version: MavlinkVersion,
16406 __input: &[u8],
16407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16408 let avail_len = __input.len();
16409 let mut payload_buf = [0; Self::ENCODED_LEN];
16410 let mut buf = if avail_len < Self::ENCODED_LEN {
16411 payload_buf[0..avail_len].copy_from_slice(__input);
16412 Bytes::new(&payload_buf)
16413 } else {
16414 Bytes::new(__input)
16415 };
16416 let mut __struct = Self::default();
16417 __struct.time_usec = buf.get_u64_le();
16418 for v in &mut __struct.attitude_quaternion {
16419 let val = buf.get_f32_le();
16420 *v = val;
16421 }
16422 __struct.rollspeed = buf.get_f32_le();
16423 __struct.pitchspeed = buf.get_f32_le();
16424 __struct.yawspeed = buf.get_f32_le();
16425 __struct.lat = buf.get_i32_le();
16426 __struct.lon = buf.get_i32_le();
16427 __struct.alt = buf.get_i32_le();
16428 __struct.vx = buf.get_i16_le();
16429 __struct.vy = buf.get_i16_le();
16430 __struct.vz = buf.get_i16_le();
16431 __struct.ind_airspeed = buf.get_u16_le();
16432 __struct.true_airspeed = buf.get_u16_le();
16433 __struct.xacc = buf.get_i16_le();
16434 __struct.yacc = buf.get_i16_le();
16435 __struct.zacc = buf.get_i16_le();
16436 Ok(__struct)
16437 }
16438 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16439 let mut __tmp = BytesMut::new(bytes);
16440 #[allow(clippy::absurd_extreme_comparisons)]
16441 #[allow(unused_comparisons)]
16442 if __tmp.remaining() < Self::ENCODED_LEN {
16443 panic!(
16444 "buffer is too small (need {} bytes, but got {})",
16445 Self::ENCODED_LEN,
16446 __tmp.remaining(),
16447 )
16448 }
16449 __tmp.put_u64_le(self.time_usec);
16450 for val in &self.attitude_quaternion {
16451 __tmp.put_f32_le(*val);
16452 }
16453 __tmp.put_f32_le(self.rollspeed);
16454 __tmp.put_f32_le(self.pitchspeed);
16455 __tmp.put_f32_le(self.yawspeed);
16456 __tmp.put_i32_le(self.lat);
16457 __tmp.put_i32_le(self.lon);
16458 __tmp.put_i32_le(self.alt);
16459 __tmp.put_i16_le(self.vx);
16460 __tmp.put_i16_le(self.vy);
16461 __tmp.put_i16_le(self.vz);
16462 __tmp.put_u16_le(self.ind_airspeed);
16463 __tmp.put_u16_le(self.true_airspeed);
16464 __tmp.put_i16_le(self.xacc);
16465 __tmp.put_i16_le(self.yacc);
16466 __tmp.put_i16_le(self.zacc);
16467 if matches!(version, MavlinkVersion::V2) {
16468 let len = __tmp.len();
16469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16470 } else {
16471 __tmp.len()
16472 }
16473 }
16474}
16475#[doc = "id: 242"]
16476#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16477#[derive(Debug, Clone, PartialEq)]
16478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16480pub struct HOME_POSITION_DATA {
16481 #[doc = "Latitude (WGS84)"]
16482 pub latitude: i32,
16483 #[doc = "Longitude (WGS84)"]
16484 pub longitude: i32,
16485 #[doc = "Altitude (MSL). Positive for up."]
16486 pub altitude: i32,
16487 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16488 pub x: f32,
16489 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16490 pub y: f32,
16491 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16492 pub z: f32,
16493 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16494 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16495 pub q: [f32; 4],
16496 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16497 pub approach_x: f32,
16498 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16499 pub approach_y: f32,
16500 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16501 pub approach_z: f32,
16502 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16504 pub time_usec: u64,
16505}
16506impl HOME_POSITION_DATA {
16507 pub const ENCODED_LEN: usize = 60usize;
16508 pub const DEFAULT: Self = Self {
16509 latitude: 0_i32,
16510 longitude: 0_i32,
16511 altitude: 0_i32,
16512 x: 0.0_f32,
16513 y: 0.0_f32,
16514 z: 0.0_f32,
16515 q: [0.0_f32; 4usize],
16516 approach_x: 0.0_f32,
16517 approach_y: 0.0_f32,
16518 approach_z: 0.0_f32,
16519 time_usec: 0_u64,
16520 };
16521 #[cfg(feature = "arbitrary")]
16522 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16523 use arbitrary::{Arbitrary, Unstructured};
16524 let mut buf = [0u8; 1024];
16525 rng.fill_bytes(&mut buf);
16526 let mut unstructured = Unstructured::new(&buf);
16527 Self::arbitrary(&mut unstructured).unwrap_or_default()
16528 }
16529}
16530impl Default for HOME_POSITION_DATA {
16531 fn default() -> Self {
16532 Self::DEFAULT.clone()
16533 }
16534}
16535impl MessageData for HOME_POSITION_DATA {
16536 type Message = MavMessage;
16537 const ID: u32 = 242u32;
16538 const NAME: &'static str = "HOME_POSITION";
16539 const EXTRA_CRC: u8 = 104u8;
16540 const ENCODED_LEN: usize = 60usize;
16541 fn deser(
16542 _version: MavlinkVersion,
16543 __input: &[u8],
16544 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16545 let avail_len = __input.len();
16546 let mut payload_buf = [0; Self::ENCODED_LEN];
16547 let mut buf = if avail_len < Self::ENCODED_LEN {
16548 payload_buf[0..avail_len].copy_from_slice(__input);
16549 Bytes::new(&payload_buf)
16550 } else {
16551 Bytes::new(__input)
16552 };
16553 let mut __struct = Self::default();
16554 __struct.latitude = buf.get_i32_le();
16555 __struct.longitude = buf.get_i32_le();
16556 __struct.altitude = buf.get_i32_le();
16557 __struct.x = buf.get_f32_le();
16558 __struct.y = buf.get_f32_le();
16559 __struct.z = buf.get_f32_le();
16560 for v in &mut __struct.q {
16561 let val = buf.get_f32_le();
16562 *v = val;
16563 }
16564 __struct.approach_x = buf.get_f32_le();
16565 __struct.approach_y = buf.get_f32_le();
16566 __struct.approach_z = buf.get_f32_le();
16567 __struct.time_usec = buf.get_u64_le();
16568 Ok(__struct)
16569 }
16570 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16571 let mut __tmp = BytesMut::new(bytes);
16572 #[allow(clippy::absurd_extreme_comparisons)]
16573 #[allow(unused_comparisons)]
16574 if __tmp.remaining() < Self::ENCODED_LEN {
16575 panic!(
16576 "buffer is too small (need {} bytes, but got {})",
16577 Self::ENCODED_LEN,
16578 __tmp.remaining(),
16579 )
16580 }
16581 __tmp.put_i32_le(self.latitude);
16582 __tmp.put_i32_le(self.longitude);
16583 __tmp.put_i32_le(self.altitude);
16584 __tmp.put_f32_le(self.x);
16585 __tmp.put_f32_le(self.y);
16586 __tmp.put_f32_le(self.z);
16587 for val in &self.q {
16588 __tmp.put_f32_le(*val);
16589 }
16590 __tmp.put_f32_le(self.approach_x);
16591 __tmp.put_f32_le(self.approach_y);
16592 __tmp.put_f32_le(self.approach_z);
16593 __tmp.put_u64_le(self.time_usec);
16594 if matches!(version, MavlinkVersion::V2) {
16595 let len = __tmp.len();
16596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16597 } else {
16598 __tmp.len()
16599 }
16600 }
16601}
16602#[doc = "id: 12920"]
16603#[doc = "Temperature and humidity from hygrometer."]
16604#[derive(Debug, Clone, PartialEq)]
16605#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16606#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16607pub struct HYGROMETER_SENSOR_DATA {
16608 #[doc = "Temperature"]
16609 pub temperature: i16,
16610 #[doc = "Humidity"]
16611 pub humidity: u16,
16612 #[doc = "Hygrometer ID"]
16613 pub id: u8,
16614}
16615impl HYGROMETER_SENSOR_DATA {
16616 pub const ENCODED_LEN: usize = 5usize;
16617 pub const DEFAULT: Self = Self {
16618 temperature: 0_i16,
16619 humidity: 0_u16,
16620 id: 0_u8,
16621 };
16622 #[cfg(feature = "arbitrary")]
16623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16624 use arbitrary::{Arbitrary, Unstructured};
16625 let mut buf = [0u8; 1024];
16626 rng.fill_bytes(&mut buf);
16627 let mut unstructured = Unstructured::new(&buf);
16628 Self::arbitrary(&mut unstructured).unwrap_or_default()
16629 }
16630}
16631impl Default for HYGROMETER_SENSOR_DATA {
16632 fn default() -> Self {
16633 Self::DEFAULT.clone()
16634 }
16635}
16636impl MessageData for HYGROMETER_SENSOR_DATA {
16637 type Message = MavMessage;
16638 const ID: u32 = 12920u32;
16639 const NAME: &'static str = "HYGROMETER_SENSOR";
16640 const EXTRA_CRC: u8 = 20u8;
16641 const ENCODED_LEN: usize = 5usize;
16642 fn deser(
16643 _version: MavlinkVersion,
16644 __input: &[u8],
16645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16646 let avail_len = __input.len();
16647 let mut payload_buf = [0; Self::ENCODED_LEN];
16648 let mut buf = if avail_len < Self::ENCODED_LEN {
16649 payload_buf[0..avail_len].copy_from_slice(__input);
16650 Bytes::new(&payload_buf)
16651 } else {
16652 Bytes::new(__input)
16653 };
16654 let mut __struct = Self::default();
16655 __struct.temperature = buf.get_i16_le();
16656 __struct.humidity = buf.get_u16_le();
16657 __struct.id = buf.get_u8();
16658 Ok(__struct)
16659 }
16660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16661 let mut __tmp = BytesMut::new(bytes);
16662 #[allow(clippy::absurd_extreme_comparisons)]
16663 #[allow(unused_comparisons)]
16664 if __tmp.remaining() < Self::ENCODED_LEN {
16665 panic!(
16666 "buffer is too small (need {} bytes, but got {})",
16667 Self::ENCODED_LEN,
16668 __tmp.remaining(),
16669 )
16670 }
16671 __tmp.put_i16_le(self.temperature);
16672 __tmp.put_u16_le(self.humidity);
16673 __tmp.put_u8(self.id);
16674 if matches!(version, MavlinkVersion::V2) {
16675 let len = __tmp.len();
16676 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16677 } else {
16678 __tmp.len()
16679 }
16680 }
16681}
16682#[doc = "id: 440"]
16683#[doc = "Illuminator status."]
16684#[derive(Debug, Clone, PartialEq)]
16685#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16686#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16687pub struct ILLUMINATOR_STATUS_DATA {
16688 #[doc = "Time since the start-up of the illuminator in ms"]
16689 pub uptime_ms: u32,
16690 #[doc = "Errors"]
16691 pub error_status: IlluminatorErrorFlags,
16692 #[doc = "Illuminator brightness"]
16693 pub brightness: f32,
16694 #[doc = "Illuminator strobing period in seconds"]
16695 pub strobe_period: f32,
16696 #[doc = "Illuminator strobing duty cycle"]
16697 pub strobe_duty_cycle: f32,
16698 #[doc = "Temperature in Celsius"]
16699 pub temp_c: f32,
16700 #[doc = "Minimum strobing period in seconds"]
16701 pub min_strobe_period: f32,
16702 #[doc = "Maximum strobing period in seconds"]
16703 pub max_strobe_period: f32,
16704 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16705 pub enable: u8,
16706 #[doc = "Supported illuminator modes"]
16707 pub mode_bitmask: IlluminatorMode,
16708 #[doc = "Illuminator mode"]
16709 pub mode: IlluminatorMode,
16710}
16711impl ILLUMINATOR_STATUS_DATA {
16712 pub const ENCODED_LEN: usize = 35usize;
16713 pub const DEFAULT: Self = Self {
16714 uptime_ms: 0_u32,
16715 error_status: IlluminatorErrorFlags::DEFAULT,
16716 brightness: 0.0_f32,
16717 strobe_period: 0.0_f32,
16718 strobe_duty_cycle: 0.0_f32,
16719 temp_c: 0.0_f32,
16720 min_strobe_period: 0.0_f32,
16721 max_strobe_period: 0.0_f32,
16722 enable: 0_u8,
16723 mode_bitmask: IlluminatorMode::DEFAULT,
16724 mode: IlluminatorMode::DEFAULT,
16725 };
16726 #[cfg(feature = "arbitrary")]
16727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16728 use arbitrary::{Arbitrary, Unstructured};
16729 let mut buf = [0u8; 1024];
16730 rng.fill_bytes(&mut buf);
16731 let mut unstructured = Unstructured::new(&buf);
16732 Self::arbitrary(&mut unstructured).unwrap_or_default()
16733 }
16734}
16735impl Default for ILLUMINATOR_STATUS_DATA {
16736 fn default() -> Self {
16737 Self::DEFAULT.clone()
16738 }
16739}
16740impl MessageData for ILLUMINATOR_STATUS_DATA {
16741 type Message = MavMessage;
16742 const ID: u32 = 440u32;
16743 const NAME: &'static str = "ILLUMINATOR_STATUS";
16744 const EXTRA_CRC: u8 = 66u8;
16745 const ENCODED_LEN: usize = 35usize;
16746 fn deser(
16747 _version: MavlinkVersion,
16748 __input: &[u8],
16749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16750 let avail_len = __input.len();
16751 let mut payload_buf = [0; Self::ENCODED_LEN];
16752 let mut buf = if avail_len < Self::ENCODED_LEN {
16753 payload_buf[0..avail_len].copy_from_slice(__input);
16754 Bytes::new(&payload_buf)
16755 } else {
16756 Bytes::new(__input)
16757 };
16758 let mut __struct = Self::default();
16759 __struct.uptime_ms = buf.get_u32_le();
16760 let tmp = buf.get_u32_le();
16761 __struct.error_status = IlluminatorErrorFlags::from_bits(
16762 tmp & IlluminatorErrorFlags::all().bits(),
16763 )
16764 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16765 flag_type: "IlluminatorErrorFlags",
16766 value: tmp as u32,
16767 })?;
16768 __struct.brightness = buf.get_f32_le();
16769 __struct.strobe_period = buf.get_f32_le();
16770 __struct.strobe_duty_cycle = buf.get_f32_le();
16771 __struct.temp_c = buf.get_f32_le();
16772 __struct.min_strobe_period = buf.get_f32_le();
16773 __struct.max_strobe_period = buf.get_f32_le();
16774 __struct.enable = buf.get_u8();
16775 let tmp = buf.get_u8();
16776 __struct.mode_bitmask =
16777 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16778 enum_type: "IlluminatorMode",
16779 value: tmp as u32,
16780 })?;
16781 let tmp = buf.get_u8();
16782 __struct.mode =
16783 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16784 enum_type: "IlluminatorMode",
16785 value: tmp as u32,
16786 })?;
16787 Ok(__struct)
16788 }
16789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16790 let mut __tmp = BytesMut::new(bytes);
16791 #[allow(clippy::absurd_extreme_comparisons)]
16792 #[allow(unused_comparisons)]
16793 if __tmp.remaining() < Self::ENCODED_LEN {
16794 panic!(
16795 "buffer is too small (need {} bytes, but got {})",
16796 Self::ENCODED_LEN,
16797 __tmp.remaining(),
16798 )
16799 }
16800 __tmp.put_u32_le(self.uptime_ms);
16801 __tmp.put_u32_le(self.error_status.bits());
16802 __tmp.put_f32_le(self.brightness);
16803 __tmp.put_f32_le(self.strobe_period);
16804 __tmp.put_f32_le(self.strobe_duty_cycle);
16805 __tmp.put_f32_le(self.temp_c);
16806 __tmp.put_f32_le(self.min_strobe_period);
16807 __tmp.put_f32_le(self.max_strobe_period);
16808 __tmp.put_u8(self.enable);
16809 __tmp.put_u8(self.mode_bitmask as u8);
16810 __tmp.put_u8(self.mode as u8);
16811 if matches!(version, MavlinkVersion::V2) {
16812 let len = __tmp.len();
16813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16814 } else {
16815 __tmp.len()
16816 }
16817 }
16818}
16819#[doc = "id: 335"]
16820#[doc = "Status of the Iridium SBD link."]
16821#[derive(Debug, Clone, PartialEq)]
16822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16824pub struct ISBD_LINK_STATUS_DATA {
16825 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16826 pub timestamp: u64,
16827 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16828 pub last_heartbeat: u64,
16829 #[doc = "Number of failed SBD sessions."]
16830 pub failed_sessions: u16,
16831 #[doc = "Number of successful SBD sessions."]
16832 pub successful_sessions: u16,
16833 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16834 pub signal_quality: u8,
16835 #[doc = "1: Ring call pending, 0: No call pending."]
16836 pub ring_pending: u8,
16837 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16838 pub tx_session_pending: u8,
16839 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16840 pub rx_session_pending: u8,
16841}
16842impl ISBD_LINK_STATUS_DATA {
16843 pub const ENCODED_LEN: usize = 24usize;
16844 pub const DEFAULT: Self = Self {
16845 timestamp: 0_u64,
16846 last_heartbeat: 0_u64,
16847 failed_sessions: 0_u16,
16848 successful_sessions: 0_u16,
16849 signal_quality: 0_u8,
16850 ring_pending: 0_u8,
16851 tx_session_pending: 0_u8,
16852 rx_session_pending: 0_u8,
16853 };
16854 #[cfg(feature = "arbitrary")]
16855 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16856 use arbitrary::{Arbitrary, Unstructured};
16857 let mut buf = [0u8; 1024];
16858 rng.fill_bytes(&mut buf);
16859 let mut unstructured = Unstructured::new(&buf);
16860 Self::arbitrary(&mut unstructured).unwrap_or_default()
16861 }
16862}
16863impl Default for ISBD_LINK_STATUS_DATA {
16864 fn default() -> Self {
16865 Self::DEFAULT.clone()
16866 }
16867}
16868impl MessageData for ISBD_LINK_STATUS_DATA {
16869 type Message = MavMessage;
16870 const ID: u32 = 335u32;
16871 const NAME: &'static str = "ISBD_LINK_STATUS";
16872 const EXTRA_CRC: u8 = 225u8;
16873 const ENCODED_LEN: usize = 24usize;
16874 fn deser(
16875 _version: MavlinkVersion,
16876 __input: &[u8],
16877 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16878 let avail_len = __input.len();
16879 let mut payload_buf = [0; Self::ENCODED_LEN];
16880 let mut buf = if avail_len < Self::ENCODED_LEN {
16881 payload_buf[0..avail_len].copy_from_slice(__input);
16882 Bytes::new(&payload_buf)
16883 } else {
16884 Bytes::new(__input)
16885 };
16886 let mut __struct = Self::default();
16887 __struct.timestamp = buf.get_u64_le();
16888 __struct.last_heartbeat = buf.get_u64_le();
16889 __struct.failed_sessions = buf.get_u16_le();
16890 __struct.successful_sessions = buf.get_u16_le();
16891 __struct.signal_quality = buf.get_u8();
16892 __struct.ring_pending = buf.get_u8();
16893 __struct.tx_session_pending = buf.get_u8();
16894 __struct.rx_session_pending = buf.get_u8();
16895 Ok(__struct)
16896 }
16897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16898 let mut __tmp = BytesMut::new(bytes);
16899 #[allow(clippy::absurd_extreme_comparisons)]
16900 #[allow(unused_comparisons)]
16901 if __tmp.remaining() < Self::ENCODED_LEN {
16902 panic!(
16903 "buffer is too small (need {} bytes, but got {})",
16904 Self::ENCODED_LEN,
16905 __tmp.remaining(),
16906 )
16907 }
16908 __tmp.put_u64_le(self.timestamp);
16909 __tmp.put_u64_le(self.last_heartbeat);
16910 __tmp.put_u16_le(self.failed_sessions);
16911 __tmp.put_u16_le(self.successful_sessions);
16912 __tmp.put_u8(self.signal_quality);
16913 __tmp.put_u8(self.ring_pending);
16914 __tmp.put_u8(self.tx_session_pending);
16915 __tmp.put_u8(self.rx_session_pending);
16916 if matches!(version, MavlinkVersion::V2) {
16917 let len = __tmp.len();
16918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16919 } else {
16920 __tmp.len()
16921 }
16922 }
16923}
16924#[doc = "id: 149"]
16925#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16926#[derive(Debug, Clone, PartialEq)]
16927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16929pub struct LANDING_TARGET_DATA {
16930 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16931 pub time_usec: u64,
16932 #[doc = "X-axis angular offset of the target from the center of the image"]
16933 pub angle_x: f32,
16934 #[doc = "Y-axis angular offset of the target from the center of the image"]
16935 pub angle_y: f32,
16936 #[doc = "Distance to the target from the vehicle"]
16937 pub distance: f32,
16938 #[doc = "Size of target along x-axis"]
16939 pub size_x: f32,
16940 #[doc = "Size of target along y-axis"]
16941 pub size_y: f32,
16942 #[doc = "The ID of the target if multiple targets are present"]
16943 pub target_num: u8,
16944 #[doc = "Coordinate frame used for following fields."]
16945 pub frame: MavFrame,
16946 #[doc = "X Position of the landing target in MAV_FRAME"]
16947 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16948 pub x: f32,
16949 #[doc = "Y Position of the landing target in MAV_FRAME"]
16950 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16951 pub y: f32,
16952 #[doc = "Z Position of the landing target in MAV_FRAME"]
16953 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16954 pub z: f32,
16955 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16956 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16957 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16958 pub q: [f32; 4],
16959 #[doc = "Type of landing target"]
16960 #[cfg_attr(feature = "serde", serde(default))]
16961 pub mavtype: LandingTargetType,
16962 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16964 pub position_valid: u8,
16965}
16966impl LANDING_TARGET_DATA {
16967 pub const ENCODED_LEN: usize = 60usize;
16968 pub const DEFAULT: Self = Self {
16969 time_usec: 0_u64,
16970 angle_x: 0.0_f32,
16971 angle_y: 0.0_f32,
16972 distance: 0.0_f32,
16973 size_x: 0.0_f32,
16974 size_y: 0.0_f32,
16975 target_num: 0_u8,
16976 frame: MavFrame::DEFAULT,
16977 x: 0.0_f32,
16978 y: 0.0_f32,
16979 z: 0.0_f32,
16980 q: [0.0_f32; 4usize],
16981 mavtype: LandingTargetType::DEFAULT,
16982 position_valid: 0_u8,
16983 };
16984 #[cfg(feature = "arbitrary")]
16985 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16986 use arbitrary::{Arbitrary, Unstructured};
16987 let mut buf = [0u8; 1024];
16988 rng.fill_bytes(&mut buf);
16989 let mut unstructured = Unstructured::new(&buf);
16990 Self::arbitrary(&mut unstructured).unwrap_or_default()
16991 }
16992}
16993impl Default for LANDING_TARGET_DATA {
16994 fn default() -> Self {
16995 Self::DEFAULT.clone()
16996 }
16997}
16998impl MessageData for LANDING_TARGET_DATA {
16999 type Message = MavMessage;
17000 const ID: u32 = 149u32;
17001 const NAME: &'static str = "LANDING_TARGET";
17002 const EXTRA_CRC: u8 = 200u8;
17003 const ENCODED_LEN: usize = 60usize;
17004 fn deser(
17005 _version: MavlinkVersion,
17006 __input: &[u8],
17007 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17008 let avail_len = __input.len();
17009 let mut payload_buf = [0; Self::ENCODED_LEN];
17010 let mut buf = if avail_len < Self::ENCODED_LEN {
17011 payload_buf[0..avail_len].copy_from_slice(__input);
17012 Bytes::new(&payload_buf)
17013 } else {
17014 Bytes::new(__input)
17015 };
17016 let mut __struct = Self::default();
17017 __struct.time_usec = buf.get_u64_le();
17018 __struct.angle_x = buf.get_f32_le();
17019 __struct.angle_y = buf.get_f32_le();
17020 __struct.distance = buf.get_f32_le();
17021 __struct.size_x = buf.get_f32_le();
17022 __struct.size_y = buf.get_f32_le();
17023 __struct.target_num = buf.get_u8();
17024 let tmp = buf.get_u8();
17025 __struct.frame =
17026 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17027 enum_type: "MavFrame",
17028 value: tmp as u32,
17029 })?;
17030 __struct.x = buf.get_f32_le();
17031 __struct.y = buf.get_f32_le();
17032 __struct.z = buf.get_f32_le();
17033 for v in &mut __struct.q {
17034 let val = buf.get_f32_le();
17035 *v = val;
17036 }
17037 let tmp = buf.get_u8();
17038 __struct.mavtype =
17039 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17040 enum_type: "LandingTargetType",
17041 value: tmp as u32,
17042 })?;
17043 __struct.position_valid = buf.get_u8();
17044 Ok(__struct)
17045 }
17046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17047 let mut __tmp = BytesMut::new(bytes);
17048 #[allow(clippy::absurd_extreme_comparisons)]
17049 #[allow(unused_comparisons)]
17050 if __tmp.remaining() < Self::ENCODED_LEN {
17051 panic!(
17052 "buffer is too small (need {} bytes, but got {})",
17053 Self::ENCODED_LEN,
17054 __tmp.remaining(),
17055 )
17056 }
17057 __tmp.put_u64_le(self.time_usec);
17058 __tmp.put_f32_le(self.angle_x);
17059 __tmp.put_f32_le(self.angle_y);
17060 __tmp.put_f32_le(self.distance);
17061 __tmp.put_f32_le(self.size_x);
17062 __tmp.put_f32_le(self.size_y);
17063 __tmp.put_u8(self.target_num);
17064 __tmp.put_u8(self.frame as u8);
17065 __tmp.put_f32_le(self.x);
17066 __tmp.put_f32_le(self.y);
17067 __tmp.put_f32_le(self.z);
17068 for val in &self.q {
17069 __tmp.put_f32_le(*val);
17070 }
17071 __tmp.put_u8(self.mavtype as u8);
17072 __tmp.put_u8(self.position_valid);
17073 if matches!(version, MavlinkVersion::V2) {
17074 let len = __tmp.len();
17075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17076 } else {
17077 __tmp.len()
17078 }
17079 }
17080}
17081#[doc = "id: 8"]
17082#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17083#[derive(Debug, Clone, PartialEq)]
17084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17086pub struct LINK_NODE_STATUS_DATA {
17087 #[doc = "Timestamp (time since system boot)."]
17088 pub timestamp: u64,
17089 #[doc = "Transmit rate"]
17090 pub tx_rate: u32,
17091 #[doc = "Receive rate"]
17092 pub rx_rate: u32,
17093 #[doc = "Messages sent"]
17094 pub messages_sent: u32,
17095 #[doc = "Messages received (estimated from counting seq)"]
17096 pub messages_received: u32,
17097 #[doc = "Messages lost (estimated from counting seq)"]
17098 pub messages_lost: u32,
17099 #[doc = "Number of bytes that could not be parsed correctly."]
17100 pub rx_parse_err: u16,
17101 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17102 pub tx_overflows: u16,
17103 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17104 pub rx_overflows: u16,
17105 #[doc = "Remaining free transmit buffer space"]
17106 pub tx_buf: u8,
17107 #[doc = "Remaining free receive buffer space"]
17108 pub rx_buf: u8,
17109}
17110impl LINK_NODE_STATUS_DATA {
17111 pub const ENCODED_LEN: usize = 36usize;
17112 pub const DEFAULT: Self = Self {
17113 timestamp: 0_u64,
17114 tx_rate: 0_u32,
17115 rx_rate: 0_u32,
17116 messages_sent: 0_u32,
17117 messages_received: 0_u32,
17118 messages_lost: 0_u32,
17119 rx_parse_err: 0_u16,
17120 tx_overflows: 0_u16,
17121 rx_overflows: 0_u16,
17122 tx_buf: 0_u8,
17123 rx_buf: 0_u8,
17124 };
17125 #[cfg(feature = "arbitrary")]
17126 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17127 use arbitrary::{Arbitrary, Unstructured};
17128 let mut buf = [0u8; 1024];
17129 rng.fill_bytes(&mut buf);
17130 let mut unstructured = Unstructured::new(&buf);
17131 Self::arbitrary(&mut unstructured).unwrap_or_default()
17132 }
17133}
17134impl Default for LINK_NODE_STATUS_DATA {
17135 fn default() -> Self {
17136 Self::DEFAULT.clone()
17137 }
17138}
17139impl MessageData for LINK_NODE_STATUS_DATA {
17140 type Message = MavMessage;
17141 const ID: u32 = 8u32;
17142 const NAME: &'static str = "LINK_NODE_STATUS";
17143 const EXTRA_CRC: u8 = 117u8;
17144 const ENCODED_LEN: usize = 36usize;
17145 fn deser(
17146 _version: MavlinkVersion,
17147 __input: &[u8],
17148 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17149 let avail_len = __input.len();
17150 let mut payload_buf = [0; Self::ENCODED_LEN];
17151 let mut buf = if avail_len < Self::ENCODED_LEN {
17152 payload_buf[0..avail_len].copy_from_slice(__input);
17153 Bytes::new(&payload_buf)
17154 } else {
17155 Bytes::new(__input)
17156 };
17157 let mut __struct = Self::default();
17158 __struct.timestamp = buf.get_u64_le();
17159 __struct.tx_rate = buf.get_u32_le();
17160 __struct.rx_rate = buf.get_u32_le();
17161 __struct.messages_sent = buf.get_u32_le();
17162 __struct.messages_received = buf.get_u32_le();
17163 __struct.messages_lost = buf.get_u32_le();
17164 __struct.rx_parse_err = buf.get_u16_le();
17165 __struct.tx_overflows = buf.get_u16_le();
17166 __struct.rx_overflows = buf.get_u16_le();
17167 __struct.tx_buf = buf.get_u8();
17168 __struct.rx_buf = buf.get_u8();
17169 Ok(__struct)
17170 }
17171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17172 let mut __tmp = BytesMut::new(bytes);
17173 #[allow(clippy::absurd_extreme_comparisons)]
17174 #[allow(unused_comparisons)]
17175 if __tmp.remaining() < Self::ENCODED_LEN {
17176 panic!(
17177 "buffer is too small (need {} bytes, but got {})",
17178 Self::ENCODED_LEN,
17179 __tmp.remaining(),
17180 )
17181 }
17182 __tmp.put_u64_le(self.timestamp);
17183 __tmp.put_u32_le(self.tx_rate);
17184 __tmp.put_u32_le(self.rx_rate);
17185 __tmp.put_u32_le(self.messages_sent);
17186 __tmp.put_u32_le(self.messages_received);
17187 __tmp.put_u32_le(self.messages_lost);
17188 __tmp.put_u16_le(self.rx_parse_err);
17189 __tmp.put_u16_le(self.tx_overflows);
17190 __tmp.put_u16_le(self.rx_overflows);
17191 __tmp.put_u8(self.tx_buf);
17192 __tmp.put_u8(self.rx_buf);
17193 if matches!(version, MavlinkVersion::V2) {
17194 let len = __tmp.len();
17195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17196 } else {
17197 __tmp.len()
17198 }
17199 }
17200}
17201#[doc = "id: 32"]
17202#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17203#[derive(Debug, Clone, PartialEq)]
17204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17206pub struct LOCAL_POSITION_NED_DATA {
17207 #[doc = "Timestamp (time since system boot)."]
17208 pub time_boot_ms: u32,
17209 #[doc = "X Position"]
17210 pub x: f32,
17211 #[doc = "Y Position"]
17212 pub y: f32,
17213 #[doc = "Z Position"]
17214 pub z: f32,
17215 #[doc = "X Speed"]
17216 pub vx: f32,
17217 #[doc = "Y Speed"]
17218 pub vy: f32,
17219 #[doc = "Z Speed"]
17220 pub vz: f32,
17221}
17222impl LOCAL_POSITION_NED_DATA {
17223 pub const ENCODED_LEN: usize = 28usize;
17224 pub const DEFAULT: Self = Self {
17225 time_boot_ms: 0_u32,
17226 x: 0.0_f32,
17227 y: 0.0_f32,
17228 z: 0.0_f32,
17229 vx: 0.0_f32,
17230 vy: 0.0_f32,
17231 vz: 0.0_f32,
17232 };
17233 #[cfg(feature = "arbitrary")]
17234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17235 use arbitrary::{Arbitrary, Unstructured};
17236 let mut buf = [0u8; 1024];
17237 rng.fill_bytes(&mut buf);
17238 let mut unstructured = Unstructured::new(&buf);
17239 Self::arbitrary(&mut unstructured).unwrap_or_default()
17240 }
17241}
17242impl Default for LOCAL_POSITION_NED_DATA {
17243 fn default() -> Self {
17244 Self::DEFAULT.clone()
17245 }
17246}
17247impl MessageData for LOCAL_POSITION_NED_DATA {
17248 type Message = MavMessage;
17249 const ID: u32 = 32u32;
17250 const NAME: &'static str = "LOCAL_POSITION_NED";
17251 const EXTRA_CRC: u8 = 185u8;
17252 const ENCODED_LEN: usize = 28usize;
17253 fn deser(
17254 _version: MavlinkVersion,
17255 __input: &[u8],
17256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17257 let avail_len = __input.len();
17258 let mut payload_buf = [0; Self::ENCODED_LEN];
17259 let mut buf = if avail_len < Self::ENCODED_LEN {
17260 payload_buf[0..avail_len].copy_from_slice(__input);
17261 Bytes::new(&payload_buf)
17262 } else {
17263 Bytes::new(__input)
17264 };
17265 let mut __struct = Self::default();
17266 __struct.time_boot_ms = buf.get_u32_le();
17267 __struct.x = buf.get_f32_le();
17268 __struct.y = buf.get_f32_le();
17269 __struct.z = buf.get_f32_le();
17270 __struct.vx = buf.get_f32_le();
17271 __struct.vy = buf.get_f32_le();
17272 __struct.vz = buf.get_f32_le();
17273 Ok(__struct)
17274 }
17275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17276 let mut __tmp = BytesMut::new(bytes);
17277 #[allow(clippy::absurd_extreme_comparisons)]
17278 #[allow(unused_comparisons)]
17279 if __tmp.remaining() < Self::ENCODED_LEN {
17280 panic!(
17281 "buffer is too small (need {} bytes, but got {})",
17282 Self::ENCODED_LEN,
17283 __tmp.remaining(),
17284 )
17285 }
17286 __tmp.put_u32_le(self.time_boot_ms);
17287 __tmp.put_f32_le(self.x);
17288 __tmp.put_f32_le(self.y);
17289 __tmp.put_f32_le(self.z);
17290 __tmp.put_f32_le(self.vx);
17291 __tmp.put_f32_le(self.vy);
17292 __tmp.put_f32_le(self.vz);
17293 if matches!(version, MavlinkVersion::V2) {
17294 let len = __tmp.len();
17295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17296 } else {
17297 __tmp.len()
17298 }
17299 }
17300}
17301#[doc = "id: 64"]
17302#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17303#[derive(Debug, Clone, PartialEq)]
17304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17306pub struct LOCAL_POSITION_NED_COV_DATA {
17307 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17308 pub time_usec: u64,
17309 #[doc = "X Position"]
17310 pub x: f32,
17311 #[doc = "Y Position"]
17312 pub y: f32,
17313 #[doc = "Z Position"]
17314 pub z: f32,
17315 #[doc = "X Speed"]
17316 pub vx: f32,
17317 #[doc = "Y Speed"]
17318 pub vy: f32,
17319 #[doc = "Z Speed"]
17320 pub vz: f32,
17321 #[doc = "X Acceleration"]
17322 pub ax: f32,
17323 #[doc = "Y Acceleration"]
17324 pub ay: f32,
17325 #[doc = "Z Acceleration"]
17326 pub az: f32,
17327 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17328 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17329 pub covariance: [f32; 45],
17330 #[doc = "Class id of the estimator this estimate originated from."]
17331 pub estimator_type: MavEstimatorType,
17332}
17333impl LOCAL_POSITION_NED_COV_DATA {
17334 pub const ENCODED_LEN: usize = 225usize;
17335 pub const DEFAULT: Self = Self {
17336 time_usec: 0_u64,
17337 x: 0.0_f32,
17338 y: 0.0_f32,
17339 z: 0.0_f32,
17340 vx: 0.0_f32,
17341 vy: 0.0_f32,
17342 vz: 0.0_f32,
17343 ax: 0.0_f32,
17344 ay: 0.0_f32,
17345 az: 0.0_f32,
17346 covariance: [0.0_f32; 45usize],
17347 estimator_type: MavEstimatorType::DEFAULT,
17348 };
17349 #[cfg(feature = "arbitrary")]
17350 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17351 use arbitrary::{Arbitrary, Unstructured};
17352 let mut buf = [0u8; 1024];
17353 rng.fill_bytes(&mut buf);
17354 let mut unstructured = Unstructured::new(&buf);
17355 Self::arbitrary(&mut unstructured).unwrap_or_default()
17356 }
17357}
17358impl Default for LOCAL_POSITION_NED_COV_DATA {
17359 fn default() -> Self {
17360 Self::DEFAULT.clone()
17361 }
17362}
17363impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17364 type Message = MavMessage;
17365 const ID: u32 = 64u32;
17366 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17367 const EXTRA_CRC: u8 = 191u8;
17368 const ENCODED_LEN: usize = 225usize;
17369 fn deser(
17370 _version: MavlinkVersion,
17371 __input: &[u8],
17372 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17373 let avail_len = __input.len();
17374 let mut payload_buf = [0; Self::ENCODED_LEN];
17375 let mut buf = if avail_len < Self::ENCODED_LEN {
17376 payload_buf[0..avail_len].copy_from_slice(__input);
17377 Bytes::new(&payload_buf)
17378 } else {
17379 Bytes::new(__input)
17380 };
17381 let mut __struct = Self::default();
17382 __struct.time_usec = buf.get_u64_le();
17383 __struct.x = buf.get_f32_le();
17384 __struct.y = buf.get_f32_le();
17385 __struct.z = buf.get_f32_le();
17386 __struct.vx = buf.get_f32_le();
17387 __struct.vy = buf.get_f32_le();
17388 __struct.vz = buf.get_f32_le();
17389 __struct.ax = buf.get_f32_le();
17390 __struct.ay = buf.get_f32_le();
17391 __struct.az = buf.get_f32_le();
17392 for v in &mut __struct.covariance {
17393 let val = buf.get_f32_le();
17394 *v = val;
17395 }
17396 let tmp = buf.get_u8();
17397 __struct.estimator_type =
17398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17399 enum_type: "MavEstimatorType",
17400 value: tmp as u32,
17401 })?;
17402 Ok(__struct)
17403 }
17404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17405 let mut __tmp = BytesMut::new(bytes);
17406 #[allow(clippy::absurd_extreme_comparisons)]
17407 #[allow(unused_comparisons)]
17408 if __tmp.remaining() < Self::ENCODED_LEN {
17409 panic!(
17410 "buffer is too small (need {} bytes, but got {})",
17411 Self::ENCODED_LEN,
17412 __tmp.remaining(),
17413 )
17414 }
17415 __tmp.put_u64_le(self.time_usec);
17416 __tmp.put_f32_le(self.x);
17417 __tmp.put_f32_le(self.y);
17418 __tmp.put_f32_le(self.z);
17419 __tmp.put_f32_le(self.vx);
17420 __tmp.put_f32_le(self.vy);
17421 __tmp.put_f32_le(self.vz);
17422 __tmp.put_f32_le(self.ax);
17423 __tmp.put_f32_le(self.ay);
17424 __tmp.put_f32_le(self.az);
17425 for val in &self.covariance {
17426 __tmp.put_f32_le(*val);
17427 }
17428 __tmp.put_u8(self.estimator_type as u8);
17429 if matches!(version, MavlinkVersion::V2) {
17430 let len = __tmp.len();
17431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17432 } else {
17433 __tmp.len()
17434 }
17435 }
17436}
17437#[doc = "id: 89"]
17438#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17439#[derive(Debug, Clone, PartialEq)]
17440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17442pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17443 #[doc = "Timestamp (time since system boot)."]
17444 pub time_boot_ms: u32,
17445 #[doc = "X Position"]
17446 pub x: f32,
17447 #[doc = "Y Position"]
17448 pub y: f32,
17449 #[doc = "Z Position"]
17450 pub z: f32,
17451 #[doc = "Roll"]
17452 pub roll: f32,
17453 #[doc = "Pitch"]
17454 pub pitch: f32,
17455 #[doc = "Yaw"]
17456 pub yaw: f32,
17457}
17458impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17459 pub const ENCODED_LEN: usize = 28usize;
17460 pub const DEFAULT: Self = Self {
17461 time_boot_ms: 0_u32,
17462 x: 0.0_f32,
17463 y: 0.0_f32,
17464 z: 0.0_f32,
17465 roll: 0.0_f32,
17466 pitch: 0.0_f32,
17467 yaw: 0.0_f32,
17468 };
17469 #[cfg(feature = "arbitrary")]
17470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17471 use arbitrary::{Arbitrary, Unstructured};
17472 let mut buf = [0u8; 1024];
17473 rng.fill_bytes(&mut buf);
17474 let mut unstructured = Unstructured::new(&buf);
17475 Self::arbitrary(&mut unstructured).unwrap_or_default()
17476 }
17477}
17478impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17479 fn default() -> Self {
17480 Self::DEFAULT.clone()
17481 }
17482}
17483impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17484 type Message = MavMessage;
17485 const ID: u32 = 89u32;
17486 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17487 const EXTRA_CRC: u8 = 231u8;
17488 const ENCODED_LEN: usize = 28usize;
17489 fn deser(
17490 _version: MavlinkVersion,
17491 __input: &[u8],
17492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17493 let avail_len = __input.len();
17494 let mut payload_buf = [0; Self::ENCODED_LEN];
17495 let mut buf = if avail_len < Self::ENCODED_LEN {
17496 payload_buf[0..avail_len].copy_from_slice(__input);
17497 Bytes::new(&payload_buf)
17498 } else {
17499 Bytes::new(__input)
17500 };
17501 let mut __struct = Self::default();
17502 __struct.time_boot_ms = buf.get_u32_le();
17503 __struct.x = buf.get_f32_le();
17504 __struct.y = buf.get_f32_le();
17505 __struct.z = buf.get_f32_le();
17506 __struct.roll = buf.get_f32_le();
17507 __struct.pitch = buf.get_f32_le();
17508 __struct.yaw = buf.get_f32_le();
17509 Ok(__struct)
17510 }
17511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17512 let mut __tmp = BytesMut::new(bytes);
17513 #[allow(clippy::absurd_extreme_comparisons)]
17514 #[allow(unused_comparisons)]
17515 if __tmp.remaining() < Self::ENCODED_LEN {
17516 panic!(
17517 "buffer is too small (need {} bytes, but got {})",
17518 Self::ENCODED_LEN,
17519 __tmp.remaining(),
17520 )
17521 }
17522 __tmp.put_u32_le(self.time_boot_ms);
17523 __tmp.put_f32_le(self.x);
17524 __tmp.put_f32_le(self.y);
17525 __tmp.put_f32_le(self.z);
17526 __tmp.put_f32_le(self.roll);
17527 __tmp.put_f32_le(self.pitch);
17528 __tmp.put_f32_le(self.yaw);
17529 if matches!(version, MavlinkVersion::V2) {
17530 let len = __tmp.len();
17531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17532 } else {
17533 __tmp.len()
17534 }
17535 }
17536}
17537#[doc = "id: 268"]
17538#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17539#[derive(Debug, Clone, PartialEq)]
17540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17542pub struct LOGGING_ACK_DATA {
17543 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17544 pub sequence: u16,
17545 #[doc = "system ID of the target"]
17546 pub target_system: u8,
17547 #[doc = "component ID of the target"]
17548 pub target_component: u8,
17549}
17550impl LOGGING_ACK_DATA {
17551 pub const ENCODED_LEN: usize = 4usize;
17552 pub const DEFAULT: Self = Self {
17553 sequence: 0_u16,
17554 target_system: 0_u8,
17555 target_component: 0_u8,
17556 };
17557 #[cfg(feature = "arbitrary")]
17558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17559 use arbitrary::{Arbitrary, Unstructured};
17560 let mut buf = [0u8; 1024];
17561 rng.fill_bytes(&mut buf);
17562 let mut unstructured = Unstructured::new(&buf);
17563 Self::arbitrary(&mut unstructured).unwrap_or_default()
17564 }
17565}
17566impl Default for LOGGING_ACK_DATA {
17567 fn default() -> Self {
17568 Self::DEFAULT.clone()
17569 }
17570}
17571impl MessageData for LOGGING_ACK_DATA {
17572 type Message = MavMessage;
17573 const ID: u32 = 268u32;
17574 const NAME: &'static str = "LOGGING_ACK";
17575 const EXTRA_CRC: u8 = 14u8;
17576 const ENCODED_LEN: usize = 4usize;
17577 fn deser(
17578 _version: MavlinkVersion,
17579 __input: &[u8],
17580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17581 let avail_len = __input.len();
17582 let mut payload_buf = [0; Self::ENCODED_LEN];
17583 let mut buf = if avail_len < Self::ENCODED_LEN {
17584 payload_buf[0..avail_len].copy_from_slice(__input);
17585 Bytes::new(&payload_buf)
17586 } else {
17587 Bytes::new(__input)
17588 };
17589 let mut __struct = Self::default();
17590 __struct.sequence = buf.get_u16_le();
17591 __struct.target_system = buf.get_u8();
17592 __struct.target_component = buf.get_u8();
17593 Ok(__struct)
17594 }
17595 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17596 let mut __tmp = BytesMut::new(bytes);
17597 #[allow(clippy::absurd_extreme_comparisons)]
17598 #[allow(unused_comparisons)]
17599 if __tmp.remaining() < Self::ENCODED_LEN {
17600 panic!(
17601 "buffer is too small (need {} bytes, but got {})",
17602 Self::ENCODED_LEN,
17603 __tmp.remaining(),
17604 )
17605 }
17606 __tmp.put_u16_le(self.sequence);
17607 __tmp.put_u8(self.target_system);
17608 __tmp.put_u8(self.target_component);
17609 if matches!(version, MavlinkVersion::V2) {
17610 let len = __tmp.len();
17611 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17612 } else {
17613 __tmp.len()
17614 }
17615 }
17616}
17617#[doc = "id: 266"]
17618#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17619#[derive(Debug, Clone, PartialEq)]
17620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17622pub struct LOGGING_DATA_DATA {
17623 #[doc = "sequence number (can wrap)"]
17624 pub sequence: u16,
17625 #[doc = "system ID of the target"]
17626 pub target_system: u8,
17627 #[doc = "component ID of the target"]
17628 pub target_component: u8,
17629 #[doc = "data length"]
17630 pub length: u8,
17631 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17632 pub first_message_offset: u8,
17633 #[doc = "logged data"]
17634 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17635 pub data: [u8; 249],
17636}
17637impl LOGGING_DATA_DATA {
17638 pub const ENCODED_LEN: usize = 255usize;
17639 pub const DEFAULT: Self = Self {
17640 sequence: 0_u16,
17641 target_system: 0_u8,
17642 target_component: 0_u8,
17643 length: 0_u8,
17644 first_message_offset: 0_u8,
17645 data: [0_u8; 249usize],
17646 };
17647 #[cfg(feature = "arbitrary")]
17648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17649 use arbitrary::{Arbitrary, Unstructured};
17650 let mut buf = [0u8; 1024];
17651 rng.fill_bytes(&mut buf);
17652 let mut unstructured = Unstructured::new(&buf);
17653 Self::arbitrary(&mut unstructured).unwrap_or_default()
17654 }
17655}
17656impl Default for LOGGING_DATA_DATA {
17657 fn default() -> Self {
17658 Self::DEFAULT.clone()
17659 }
17660}
17661impl MessageData for LOGGING_DATA_DATA {
17662 type Message = MavMessage;
17663 const ID: u32 = 266u32;
17664 const NAME: &'static str = "LOGGING_DATA";
17665 const EXTRA_CRC: u8 = 193u8;
17666 const ENCODED_LEN: usize = 255usize;
17667 fn deser(
17668 _version: MavlinkVersion,
17669 __input: &[u8],
17670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17671 let avail_len = __input.len();
17672 let mut payload_buf = [0; Self::ENCODED_LEN];
17673 let mut buf = if avail_len < Self::ENCODED_LEN {
17674 payload_buf[0..avail_len].copy_from_slice(__input);
17675 Bytes::new(&payload_buf)
17676 } else {
17677 Bytes::new(__input)
17678 };
17679 let mut __struct = Self::default();
17680 __struct.sequence = buf.get_u16_le();
17681 __struct.target_system = buf.get_u8();
17682 __struct.target_component = buf.get_u8();
17683 __struct.length = buf.get_u8();
17684 __struct.first_message_offset = buf.get_u8();
17685 for v in &mut __struct.data {
17686 let val = buf.get_u8();
17687 *v = val;
17688 }
17689 Ok(__struct)
17690 }
17691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17692 let mut __tmp = BytesMut::new(bytes);
17693 #[allow(clippy::absurd_extreme_comparisons)]
17694 #[allow(unused_comparisons)]
17695 if __tmp.remaining() < Self::ENCODED_LEN {
17696 panic!(
17697 "buffer is too small (need {} bytes, but got {})",
17698 Self::ENCODED_LEN,
17699 __tmp.remaining(),
17700 )
17701 }
17702 __tmp.put_u16_le(self.sequence);
17703 __tmp.put_u8(self.target_system);
17704 __tmp.put_u8(self.target_component);
17705 __tmp.put_u8(self.length);
17706 __tmp.put_u8(self.first_message_offset);
17707 for val in &self.data {
17708 __tmp.put_u8(*val);
17709 }
17710 if matches!(version, MavlinkVersion::V2) {
17711 let len = __tmp.len();
17712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17713 } else {
17714 __tmp.len()
17715 }
17716 }
17717}
17718#[doc = "id: 267"]
17719#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17720#[derive(Debug, Clone, PartialEq)]
17721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17723pub struct LOGGING_DATA_ACKED_DATA {
17724 #[doc = "sequence number (can wrap)"]
17725 pub sequence: u16,
17726 #[doc = "system ID of the target"]
17727 pub target_system: u8,
17728 #[doc = "component ID of the target"]
17729 pub target_component: u8,
17730 #[doc = "data length"]
17731 pub length: u8,
17732 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17733 pub first_message_offset: u8,
17734 #[doc = "logged data"]
17735 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17736 pub data: [u8; 249],
17737}
17738impl LOGGING_DATA_ACKED_DATA {
17739 pub const ENCODED_LEN: usize = 255usize;
17740 pub const DEFAULT: Self = Self {
17741 sequence: 0_u16,
17742 target_system: 0_u8,
17743 target_component: 0_u8,
17744 length: 0_u8,
17745 first_message_offset: 0_u8,
17746 data: [0_u8; 249usize],
17747 };
17748 #[cfg(feature = "arbitrary")]
17749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17750 use arbitrary::{Arbitrary, Unstructured};
17751 let mut buf = [0u8; 1024];
17752 rng.fill_bytes(&mut buf);
17753 let mut unstructured = Unstructured::new(&buf);
17754 Self::arbitrary(&mut unstructured).unwrap_or_default()
17755 }
17756}
17757impl Default for LOGGING_DATA_ACKED_DATA {
17758 fn default() -> Self {
17759 Self::DEFAULT.clone()
17760 }
17761}
17762impl MessageData for LOGGING_DATA_ACKED_DATA {
17763 type Message = MavMessage;
17764 const ID: u32 = 267u32;
17765 const NAME: &'static str = "LOGGING_DATA_ACKED";
17766 const EXTRA_CRC: u8 = 35u8;
17767 const ENCODED_LEN: usize = 255usize;
17768 fn deser(
17769 _version: MavlinkVersion,
17770 __input: &[u8],
17771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17772 let avail_len = __input.len();
17773 let mut payload_buf = [0; Self::ENCODED_LEN];
17774 let mut buf = if avail_len < Self::ENCODED_LEN {
17775 payload_buf[0..avail_len].copy_from_slice(__input);
17776 Bytes::new(&payload_buf)
17777 } else {
17778 Bytes::new(__input)
17779 };
17780 let mut __struct = Self::default();
17781 __struct.sequence = buf.get_u16_le();
17782 __struct.target_system = buf.get_u8();
17783 __struct.target_component = buf.get_u8();
17784 __struct.length = buf.get_u8();
17785 __struct.first_message_offset = buf.get_u8();
17786 for v in &mut __struct.data {
17787 let val = buf.get_u8();
17788 *v = val;
17789 }
17790 Ok(__struct)
17791 }
17792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17793 let mut __tmp = BytesMut::new(bytes);
17794 #[allow(clippy::absurd_extreme_comparisons)]
17795 #[allow(unused_comparisons)]
17796 if __tmp.remaining() < Self::ENCODED_LEN {
17797 panic!(
17798 "buffer is too small (need {} bytes, but got {})",
17799 Self::ENCODED_LEN,
17800 __tmp.remaining(),
17801 )
17802 }
17803 __tmp.put_u16_le(self.sequence);
17804 __tmp.put_u8(self.target_system);
17805 __tmp.put_u8(self.target_component);
17806 __tmp.put_u8(self.length);
17807 __tmp.put_u8(self.first_message_offset);
17808 for val in &self.data {
17809 __tmp.put_u8(*val);
17810 }
17811 if matches!(version, MavlinkVersion::V2) {
17812 let len = __tmp.len();
17813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17814 } else {
17815 __tmp.len()
17816 }
17817 }
17818}
17819#[doc = "id: 120"]
17820#[doc = "Reply to LOG_REQUEST_DATA."]
17821#[derive(Debug, Clone, PartialEq)]
17822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17824pub struct LOG_DATA_DATA {
17825 #[doc = "Offset into the log"]
17826 pub ofs: u32,
17827 #[doc = "Log id (from LOG_ENTRY reply)"]
17828 pub id: u16,
17829 #[doc = "Number of bytes (zero for end of log)"]
17830 pub count: u8,
17831 #[doc = "log data"]
17832 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17833 pub data: [u8; 90],
17834}
17835impl LOG_DATA_DATA {
17836 pub const ENCODED_LEN: usize = 97usize;
17837 pub const DEFAULT: Self = Self {
17838 ofs: 0_u32,
17839 id: 0_u16,
17840 count: 0_u8,
17841 data: [0_u8; 90usize],
17842 };
17843 #[cfg(feature = "arbitrary")]
17844 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17845 use arbitrary::{Arbitrary, Unstructured};
17846 let mut buf = [0u8; 1024];
17847 rng.fill_bytes(&mut buf);
17848 let mut unstructured = Unstructured::new(&buf);
17849 Self::arbitrary(&mut unstructured).unwrap_or_default()
17850 }
17851}
17852impl Default for LOG_DATA_DATA {
17853 fn default() -> Self {
17854 Self::DEFAULT.clone()
17855 }
17856}
17857impl MessageData for LOG_DATA_DATA {
17858 type Message = MavMessage;
17859 const ID: u32 = 120u32;
17860 const NAME: &'static str = "LOG_DATA";
17861 const EXTRA_CRC: u8 = 134u8;
17862 const ENCODED_LEN: usize = 97usize;
17863 fn deser(
17864 _version: MavlinkVersion,
17865 __input: &[u8],
17866 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17867 let avail_len = __input.len();
17868 let mut payload_buf = [0; Self::ENCODED_LEN];
17869 let mut buf = if avail_len < Self::ENCODED_LEN {
17870 payload_buf[0..avail_len].copy_from_slice(__input);
17871 Bytes::new(&payload_buf)
17872 } else {
17873 Bytes::new(__input)
17874 };
17875 let mut __struct = Self::default();
17876 __struct.ofs = buf.get_u32_le();
17877 __struct.id = buf.get_u16_le();
17878 __struct.count = buf.get_u8();
17879 for v in &mut __struct.data {
17880 let val = buf.get_u8();
17881 *v = val;
17882 }
17883 Ok(__struct)
17884 }
17885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17886 let mut __tmp = BytesMut::new(bytes);
17887 #[allow(clippy::absurd_extreme_comparisons)]
17888 #[allow(unused_comparisons)]
17889 if __tmp.remaining() < Self::ENCODED_LEN {
17890 panic!(
17891 "buffer is too small (need {} bytes, but got {})",
17892 Self::ENCODED_LEN,
17893 __tmp.remaining(),
17894 )
17895 }
17896 __tmp.put_u32_le(self.ofs);
17897 __tmp.put_u16_le(self.id);
17898 __tmp.put_u8(self.count);
17899 for val in &self.data {
17900 __tmp.put_u8(*val);
17901 }
17902 if matches!(version, MavlinkVersion::V2) {
17903 let len = __tmp.len();
17904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17905 } else {
17906 __tmp.len()
17907 }
17908 }
17909}
17910#[doc = "id: 118"]
17911#[doc = "Reply to LOG_REQUEST_LIST."]
17912#[derive(Debug, Clone, PartialEq)]
17913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17915pub struct LOG_ENTRY_DATA {
17916 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17917 pub time_utc: u32,
17918 #[doc = "Size of the log (may be approximate)"]
17919 pub size: u32,
17920 #[doc = "Log id"]
17921 pub id: u16,
17922 #[doc = "Total number of logs"]
17923 pub num_logs: u16,
17924 #[doc = "High log number"]
17925 pub last_log_num: u16,
17926}
17927impl LOG_ENTRY_DATA {
17928 pub const ENCODED_LEN: usize = 14usize;
17929 pub const DEFAULT: Self = Self {
17930 time_utc: 0_u32,
17931 size: 0_u32,
17932 id: 0_u16,
17933 num_logs: 0_u16,
17934 last_log_num: 0_u16,
17935 };
17936 #[cfg(feature = "arbitrary")]
17937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17938 use arbitrary::{Arbitrary, Unstructured};
17939 let mut buf = [0u8; 1024];
17940 rng.fill_bytes(&mut buf);
17941 let mut unstructured = Unstructured::new(&buf);
17942 Self::arbitrary(&mut unstructured).unwrap_or_default()
17943 }
17944}
17945impl Default for LOG_ENTRY_DATA {
17946 fn default() -> Self {
17947 Self::DEFAULT.clone()
17948 }
17949}
17950impl MessageData for LOG_ENTRY_DATA {
17951 type Message = MavMessage;
17952 const ID: u32 = 118u32;
17953 const NAME: &'static str = "LOG_ENTRY";
17954 const EXTRA_CRC: u8 = 56u8;
17955 const ENCODED_LEN: usize = 14usize;
17956 fn deser(
17957 _version: MavlinkVersion,
17958 __input: &[u8],
17959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17960 let avail_len = __input.len();
17961 let mut payload_buf = [0; Self::ENCODED_LEN];
17962 let mut buf = if avail_len < Self::ENCODED_LEN {
17963 payload_buf[0..avail_len].copy_from_slice(__input);
17964 Bytes::new(&payload_buf)
17965 } else {
17966 Bytes::new(__input)
17967 };
17968 let mut __struct = Self::default();
17969 __struct.time_utc = buf.get_u32_le();
17970 __struct.size = buf.get_u32_le();
17971 __struct.id = buf.get_u16_le();
17972 __struct.num_logs = buf.get_u16_le();
17973 __struct.last_log_num = buf.get_u16_le();
17974 Ok(__struct)
17975 }
17976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17977 let mut __tmp = BytesMut::new(bytes);
17978 #[allow(clippy::absurd_extreme_comparisons)]
17979 #[allow(unused_comparisons)]
17980 if __tmp.remaining() < Self::ENCODED_LEN {
17981 panic!(
17982 "buffer is too small (need {} bytes, but got {})",
17983 Self::ENCODED_LEN,
17984 __tmp.remaining(),
17985 )
17986 }
17987 __tmp.put_u32_le(self.time_utc);
17988 __tmp.put_u32_le(self.size);
17989 __tmp.put_u16_le(self.id);
17990 __tmp.put_u16_le(self.num_logs);
17991 __tmp.put_u16_le(self.last_log_num);
17992 if matches!(version, MavlinkVersion::V2) {
17993 let len = __tmp.len();
17994 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17995 } else {
17996 __tmp.len()
17997 }
17998 }
17999}
18000#[doc = "id: 121"]
18001#[doc = "Erase all logs."]
18002#[derive(Debug, Clone, PartialEq)]
18003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18005pub struct LOG_ERASE_DATA {
18006 #[doc = "System ID"]
18007 pub target_system: u8,
18008 #[doc = "Component ID"]
18009 pub target_component: u8,
18010}
18011impl LOG_ERASE_DATA {
18012 pub const ENCODED_LEN: usize = 2usize;
18013 pub const DEFAULT: Self = Self {
18014 target_system: 0_u8,
18015 target_component: 0_u8,
18016 };
18017 #[cfg(feature = "arbitrary")]
18018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18019 use arbitrary::{Arbitrary, Unstructured};
18020 let mut buf = [0u8; 1024];
18021 rng.fill_bytes(&mut buf);
18022 let mut unstructured = Unstructured::new(&buf);
18023 Self::arbitrary(&mut unstructured).unwrap_or_default()
18024 }
18025}
18026impl Default for LOG_ERASE_DATA {
18027 fn default() -> Self {
18028 Self::DEFAULT.clone()
18029 }
18030}
18031impl MessageData for LOG_ERASE_DATA {
18032 type Message = MavMessage;
18033 const ID: u32 = 121u32;
18034 const NAME: &'static str = "LOG_ERASE";
18035 const EXTRA_CRC: u8 = 237u8;
18036 const ENCODED_LEN: usize = 2usize;
18037 fn deser(
18038 _version: MavlinkVersion,
18039 __input: &[u8],
18040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18041 let avail_len = __input.len();
18042 let mut payload_buf = [0; Self::ENCODED_LEN];
18043 let mut buf = if avail_len < Self::ENCODED_LEN {
18044 payload_buf[0..avail_len].copy_from_slice(__input);
18045 Bytes::new(&payload_buf)
18046 } else {
18047 Bytes::new(__input)
18048 };
18049 let mut __struct = Self::default();
18050 __struct.target_system = buf.get_u8();
18051 __struct.target_component = buf.get_u8();
18052 Ok(__struct)
18053 }
18054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18055 let mut __tmp = BytesMut::new(bytes);
18056 #[allow(clippy::absurd_extreme_comparisons)]
18057 #[allow(unused_comparisons)]
18058 if __tmp.remaining() < Self::ENCODED_LEN {
18059 panic!(
18060 "buffer is too small (need {} bytes, but got {})",
18061 Self::ENCODED_LEN,
18062 __tmp.remaining(),
18063 )
18064 }
18065 __tmp.put_u8(self.target_system);
18066 __tmp.put_u8(self.target_component);
18067 if matches!(version, MavlinkVersion::V2) {
18068 let len = __tmp.len();
18069 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18070 } else {
18071 __tmp.len()
18072 }
18073 }
18074}
18075#[doc = "id: 119"]
18076#[doc = "Request a chunk of a log."]
18077#[derive(Debug, Clone, PartialEq)]
18078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18080pub struct LOG_REQUEST_DATA_DATA {
18081 #[doc = "Offset into the log"]
18082 pub ofs: u32,
18083 #[doc = "Number of bytes"]
18084 pub count: u32,
18085 #[doc = "Log id (from LOG_ENTRY reply)"]
18086 pub id: u16,
18087 #[doc = "System ID"]
18088 pub target_system: u8,
18089 #[doc = "Component ID"]
18090 pub target_component: u8,
18091}
18092impl LOG_REQUEST_DATA_DATA {
18093 pub const ENCODED_LEN: usize = 12usize;
18094 pub const DEFAULT: Self = Self {
18095 ofs: 0_u32,
18096 count: 0_u32,
18097 id: 0_u16,
18098 target_system: 0_u8,
18099 target_component: 0_u8,
18100 };
18101 #[cfg(feature = "arbitrary")]
18102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18103 use arbitrary::{Arbitrary, Unstructured};
18104 let mut buf = [0u8; 1024];
18105 rng.fill_bytes(&mut buf);
18106 let mut unstructured = Unstructured::new(&buf);
18107 Self::arbitrary(&mut unstructured).unwrap_or_default()
18108 }
18109}
18110impl Default for LOG_REQUEST_DATA_DATA {
18111 fn default() -> Self {
18112 Self::DEFAULT.clone()
18113 }
18114}
18115impl MessageData for LOG_REQUEST_DATA_DATA {
18116 type Message = MavMessage;
18117 const ID: u32 = 119u32;
18118 const NAME: &'static str = "LOG_REQUEST_DATA";
18119 const EXTRA_CRC: u8 = 116u8;
18120 const ENCODED_LEN: usize = 12usize;
18121 fn deser(
18122 _version: MavlinkVersion,
18123 __input: &[u8],
18124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18125 let avail_len = __input.len();
18126 let mut payload_buf = [0; Self::ENCODED_LEN];
18127 let mut buf = if avail_len < Self::ENCODED_LEN {
18128 payload_buf[0..avail_len].copy_from_slice(__input);
18129 Bytes::new(&payload_buf)
18130 } else {
18131 Bytes::new(__input)
18132 };
18133 let mut __struct = Self::default();
18134 __struct.ofs = buf.get_u32_le();
18135 __struct.count = buf.get_u32_le();
18136 __struct.id = buf.get_u16_le();
18137 __struct.target_system = buf.get_u8();
18138 __struct.target_component = buf.get_u8();
18139 Ok(__struct)
18140 }
18141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18142 let mut __tmp = BytesMut::new(bytes);
18143 #[allow(clippy::absurd_extreme_comparisons)]
18144 #[allow(unused_comparisons)]
18145 if __tmp.remaining() < Self::ENCODED_LEN {
18146 panic!(
18147 "buffer is too small (need {} bytes, but got {})",
18148 Self::ENCODED_LEN,
18149 __tmp.remaining(),
18150 )
18151 }
18152 __tmp.put_u32_le(self.ofs);
18153 __tmp.put_u32_le(self.count);
18154 __tmp.put_u16_le(self.id);
18155 __tmp.put_u8(self.target_system);
18156 __tmp.put_u8(self.target_component);
18157 if matches!(version, MavlinkVersion::V2) {
18158 let len = __tmp.len();
18159 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18160 } else {
18161 __tmp.len()
18162 }
18163 }
18164}
18165#[doc = "id: 122"]
18166#[doc = "Stop log transfer and resume normal logging."]
18167#[derive(Debug, Clone, PartialEq)]
18168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18170pub struct LOG_REQUEST_END_DATA {
18171 #[doc = "System ID"]
18172 pub target_system: u8,
18173 #[doc = "Component ID"]
18174 pub target_component: u8,
18175}
18176impl LOG_REQUEST_END_DATA {
18177 pub const ENCODED_LEN: usize = 2usize;
18178 pub const DEFAULT: Self = Self {
18179 target_system: 0_u8,
18180 target_component: 0_u8,
18181 };
18182 #[cfg(feature = "arbitrary")]
18183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18184 use arbitrary::{Arbitrary, Unstructured};
18185 let mut buf = [0u8; 1024];
18186 rng.fill_bytes(&mut buf);
18187 let mut unstructured = Unstructured::new(&buf);
18188 Self::arbitrary(&mut unstructured).unwrap_or_default()
18189 }
18190}
18191impl Default for LOG_REQUEST_END_DATA {
18192 fn default() -> Self {
18193 Self::DEFAULT.clone()
18194 }
18195}
18196impl MessageData for LOG_REQUEST_END_DATA {
18197 type Message = MavMessage;
18198 const ID: u32 = 122u32;
18199 const NAME: &'static str = "LOG_REQUEST_END";
18200 const EXTRA_CRC: u8 = 203u8;
18201 const ENCODED_LEN: usize = 2usize;
18202 fn deser(
18203 _version: MavlinkVersion,
18204 __input: &[u8],
18205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18206 let avail_len = __input.len();
18207 let mut payload_buf = [0; Self::ENCODED_LEN];
18208 let mut buf = if avail_len < Self::ENCODED_LEN {
18209 payload_buf[0..avail_len].copy_from_slice(__input);
18210 Bytes::new(&payload_buf)
18211 } else {
18212 Bytes::new(__input)
18213 };
18214 let mut __struct = Self::default();
18215 __struct.target_system = buf.get_u8();
18216 __struct.target_component = buf.get_u8();
18217 Ok(__struct)
18218 }
18219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18220 let mut __tmp = BytesMut::new(bytes);
18221 #[allow(clippy::absurd_extreme_comparisons)]
18222 #[allow(unused_comparisons)]
18223 if __tmp.remaining() < Self::ENCODED_LEN {
18224 panic!(
18225 "buffer is too small (need {} bytes, but got {})",
18226 Self::ENCODED_LEN,
18227 __tmp.remaining(),
18228 )
18229 }
18230 __tmp.put_u8(self.target_system);
18231 __tmp.put_u8(self.target_component);
18232 if matches!(version, MavlinkVersion::V2) {
18233 let len = __tmp.len();
18234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18235 } else {
18236 __tmp.len()
18237 }
18238 }
18239}
18240#[doc = "id: 117"]
18241#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18242#[derive(Debug, Clone, PartialEq)]
18243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18245pub struct LOG_REQUEST_LIST_DATA {
18246 #[doc = "First log id (0 for first available)"]
18247 pub start: u16,
18248 #[doc = "Last log id (0xffff for last available)"]
18249 pub end: u16,
18250 #[doc = "System ID"]
18251 pub target_system: u8,
18252 #[doc = "Component ID"]
18253 pub target_component: u8,
18254}
18255impl LOG_REQUEST_LIST_DATA {
18256 pub const ENCODED_LEN: usize = 6usize;
18257 pub const DEFAULT: Self = Self {
18258 start: 0_u16,
18259 end: 0_u16,
18260 target_system: 0_u8,
18261 target_component: 0_u8,
18262 };
18263 #[cfg(feature = "arbitrary")]
18264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18265 use arbitrary::{Arbitrary, Unstructured};
18266 let mut buf = [0u8; 1024];
18267 rng.fill_bytes(&mut buf);
18268 let mut unstructured = Unstructured::new(&buf);
18269 Self::arbitrary(&mut unstructured).unwrap_or_default()
18270 }
18271}
18272impl Default for LOG_REQUEST_LIST_DATA {
18273 fn default() -> Self {
18274 Self::DEFAULT.clone()
18275 }
18276}
18277impl MessageData for LOG_REQUEST_LIST_DATA {
18278 type Message = MavMessage;
18279 const ID: u32 = 117u32;
18280 const NAME: &'static str = "LOG_REQUEST_LIST";
18281 const EXTRA_CRC: u8 = 128u8;
18282 const ENCODED_LEN: usize = 6usize;
18283 fn deser(
18284 _version: MavlinkVersion,
18285 __input: &[u8],
18286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18287 let avail_len = __input.len();
18288 let mut payload_buf = [0; Self::ENCODED_LEN];
18289 let mut buf = if avail_len < Self::ENCODED_LEN {
18290 payload_buf[0..avail_len].copy_from_slice(__input);
18291 Bytes::new(&payload_buf)
18292 } else {
18293 Bytes::new(__input)
18294 };
18295 let mut __struct = Self::default();
18296 __struct.start = buf.get_u16_le();
18297 __struct.end = buf.get_u16_le();
18298 __struct.target_system = buf.get_u8();
18299 __struct.target_component = buf.get_u8();
18300 Ok(__struct)
18301 }
18302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18303 let mut __tmp = BytesMut::new(bytes);
18304 #[allow(clippy::absurd_extreme_comparisons)]
18305 #[allow(unused_comparisons)]
18306 if __tmp.remaining() < Self::ENCODED_LEN {
18307 panic!(
18308 "buffer is too small (need {} bytes, but got {})",
18309 Self::ENCODED_LEN,
18310 __tmp.remaining(),
18311 )
18312 }
18313 __tmp.put_u16_le(self.start);
18314 __tmp.put_u16_le(self.end);
18315 __tmp.put_u8(self.target_system);
18316 __tmp.put_u8(self.target_component);
18317 if matches!(version, MavlinkVersion::V2) {
18318 let len = __tmp.len();
18319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18320 } else {
18321 __tmp.len()
18322 }
18323 }
18324}
18325#[doc = "id: 192"]
18326#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18327#[derive(Debug, Clone, PartialEq)]
18328#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18329#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18330pub struct MAG_CAL_REPORT_DATA {
18331 #[doc = "RMS milligauss residuals."]
18332 pub fitness: f32,
18333 #[doc = "X offset."]
18334 pub ofs_x: f32,
18335 #[doc = "Y offset."]
18336 pub ofs_y: f32,
18337 #[doc = "Z offset."]
18338 pub ofs_z: f32,
18339 #[doc = "X diagonal (matrix 11)."]
18340 pub diag_x: f32,
18341 #[doc = "Y diagonal (matrix 22)."]
18342 pub diag_y: f32,
18343 #[doc = "Z diagonal (matrix 33)."]
18344 pub diag_z: f32,
18345 #[doc = "X off-diagonal (matrix 12 and 21)."]
18346 pub offdiag_x: f32,
18347 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18348 pub offdiag_y: f32,
18349 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18350 pub offdiag_z: f32,
18351 #[doc = "Compass being calibrated."]
18352 pub compass_id: u8,
18353 #[doc = "Bitmask of compasses being calibrated."]
18354 pub cal_mask: u8,
18355 #[doc = "Calibration Status."]
18356 pub cal_status: MagCalStatus,
18357 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18358 pub autosaved: u8,
18359 #[doc = "Confidence in orientation (higher is better)."]
18360 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18361 pub orientation_confidence: f32,
18362 #[doc = "orientation before calibration."]
18363 #[cfg_attr(feature = "serde", serde(default))]
18364 pub old_orientation: MavSensorOrientation,
18365 #[doc = "orientation after calibration."]
18366 #[cfg_attr(feature = "serde", serde(default))]
18367 pub new_orientation: MavSensorOrientation,
18368 #[doc = "field radius correction factor"]
18369 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18370 pub scale_factor: f32,
18371}
18372impl MAG_CAL_REPORT_DATA {
18373 pub const ENCODED_LEN: usize = 54usize;
18374 pub const DEFAULT: Self = Self {
18375 fitness: 0.0_f32,
18376 ofs_x: 0.0_f32,
18377 ofs_y: 0.0_f32,
18378 ofs_z: 0.0_f32,
18379 diag_x: 0.0_f32,
18380 diag_y: 0.0_f32,
18381 diag_z: 0.0_f32,
18382 offdiag_x: 0.0_f32,
18383 offdiag_y: 0.0_f32,
18384 offdiag_z: 0.0_f32,
18385 compass_id: 0_u8,
18386 cal_mask: 0_u8,
18387 cal_status: MagCalStatus::DEFAULT,
18388 autosaved: 0_u8,
18389 orientation_confidence: 0.0_f32,
18390 old_orientation: MavSensorOrientation::DEFAULT,
18391 new_orientation: MavSensorOrientation::DEFAULT,
18392 scale_factor: 0.0_f32,
18393 };
18394 #[cfg(feature = "arbitrary")]
18395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18396 use arbitrary::{Arbitrary, Unstructured};
18397 let mut buf = [0u8; 1024];
18398 rng.fill_bytes(&mut buf);
18399 let mut unstructured = Unstructured::new(&buf);
18400 Self::arbitrary(&mut unstructured).unwrap_or_default()
18401 }
18402}
18403impl Default for MAG_CAL_REPORT_DATA {
18404 fn default() -> Self {
18405 Self::DEFAULT.clone()
18406 }
18407}
18408impl MessageData for MAG_CAL_REPORT_DATA {
18409 type Message = MavMessage;
18410 const ID: u32 = 192u32;
18411 const NAME: &'static str = "MAG_CAL_REPORT";
18412 const EXTRA_CRC: u8 = 36u8;
18413 const ENCODED_LEN: usize = 54usize;
18414 fn deser(
18415 _version: MavlinkVersion,
18416 __input: &[u8],
18417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18418 let avail_len = __input.len();
18419 let mut payload_buf = [0; Self::ENCODED_LEN];
18420 let mut buf = if avail_len < Self::ENCODED_LEN {
18421 payload_buf[0..avail_len].copy_from_slice(__input);
18422 Bytes::new(&payload_buf)
18423 } else {
18424 Bytes::new(__input)
18425 };
18426 let mut __struct = Self::default();
18427 __struct.fitness = buf.get_f32_le();
18428 __struct.ofs_x = buf.get_f32_le();
18429 __struct.ofs_y = buf.get_f32_le();
18430 __struct.ofs_z = buf.get_f32_le();
18431 __struct.diag_x = buf.get_f32_le();
18432 __struct.diag_y = buf.get_f32_le();
18433 __struct.diag_z = buf.get_f32_le();
18434 __struct.offdiag_x = buf.get_f32_le();
18435 __struct.offdiag_y = buf.get_f32_le();
18436 __struct.offdiag_z = buf.get_f32_le();
18437 __struct.compass_id = buf.get_u8();
18438 __struct.cal_mask = buf.get_u8();
18439 let tmp = buf.get_u8();
18440 __struct.cal_status =
18441 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18442 enum_type: "MagCalStatus",
18443 value: tmp as u32,
18444 })?;
18445 __struct.autosaved = buf.get_u8();
18446 __struct.orientation_confidence = buf.get_f32_le();
18447 let tmp = buf.get_u8();
18448 __struct.old_orientation =
18449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18450 enum_type: "MavSensorOrientation",
18451 value: tmp as u32,
18452 })?;
18453 let tmp = buf.get_u8();
18454 __struct.new_orientation =
18455 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18456 enum_type: "MavSensorOrientation",
18457 value: tmp as u32,
18458 })?;
18459 __struct.scale_factor = buf.get_f32_le();
18460 Ok(__struct)
18461 }
18462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18463 let mut __tmp = BytesMut::new(bytes);
18464 #[allow(clippy::absurd_extreme_comparisons)]
18465 #[allow(unused_comparisons)]
18466 if __tmp.remaining() < Self::ENCODED_LEN {
18467 panic!(
18468 "buffer is too small (need {} bytes, but got {})",
18469 Self::ENCODED_LEN,
18470 __tmp.remaining(),
18471 )
18472 }
18473 __tmp.put_f32_le(self.fitness);
18474 __tmp.put_f32_le(self.ofs_x);
18475 __tmp.put_f32_le(self.ofs_y);
18476 __tmp.put_f32_le(self.ofs_z);
18477 __tmp.put_f32_le(self.diag_x);
18478 __tmp.put_f32_le(self.diag_y);
18479 __tmp.put_f32_le(self.diag_z);
18480 __tmp.put_f32_le(self.offdiag_x);
18481 __tmp.put_f32_le(self.offdiag_y);
18482 __tmp.put_f32_le(self.offdiag_z);
18483 __tmp.put_u8(self.compass_id);
18484 __tmp.put_u8(self.cal_mask);
18485 __tmp.put_u8(self.cal_status as u8);
18486 __tmp.put_u8(self.autosaved);
18487 __tmp.put_f32_le(self.orientation_confidence);
18488 __tmp.put_u8(self.old_orientation as u8);
18489 __tmp.put_u8(self.new_orientation as u8);
18490 __tmp.put_f32_le(self.scale_factor);
18491 if matches!(version, MavlinkVersion::V2) {
18492 let len = __tmp.len();
18493 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18494 } else {
18495 __tmp.len()
18496 }
18497 }
18498}
18499#[doc = "id: 69"]
18500#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18501#[derive(Debug, Clone, PartialEq)]
18502#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18503#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18504pub struct MANUAL_CONTROL_DATA {
18505 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18506 pub x: i16,
18507 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18508 pub y: i16,
18509 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18510 pub z: i16,
18511 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18512 pub r: i16,
18513 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18514 pub buttons: u16,
18515 #[doc = "The system to be controlled."]
18516 pub target: u8,
18517 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18518 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18519 pub buttons2: u16,
18520 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18521 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18522 pub enabled_extensions: u8,
18523 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18524 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18525 pub s: i16,
18526 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18527 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18528 pub t: i16,
18529 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18530 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18531 pub aux1: i16,
18532 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18533 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18534 pub aux2: i16,
18535 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18536 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18537 pub aux3: i16,
18538 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18539 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18540 pub aux4: i16,
18541 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18543 pub aux5: i16,
18544 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18545 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18546 pub aux6: i16,
18547}
18548impl MANUAL_CONTROL_DATA {
18549 pub const ENCODED_LEN: usize = 30usize;
18550 pub const DEFAULT: Self = Self {
18551 x: 0_i16,
18552 y: 0_i16,
18553 z: 0_i16,
18554 r: 0_i16,
18555 buttons: 0_u16,
18556 target: 0_u8,
18557 buttons2: 0_u16,
18558 enabled_extensions: 0_u8,
18559 s: 0_i16,
18560 t: 0_i16,
18561 aux1: 0_i16,
18562 aux2: 0_i16,
18563 aux3: 0_i16,
18564 aux4: 0_i16,
18565 aux5: 0_i16,
18566 aux6: 0_i16,
18567 };
18568 #[cfg(feature = "arbitrary")]
18569 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18570 use arbitrary::{Arbitrary, Unstructured};
18571 let mut buf = [0u8; 1024];
18572 rng.fill_bytes(&mut buf);
18573 let mut unstructured = Unstructured::new(&buf);
18574 Self::arbitrary(&mut unstructured).unwrap_or_default()
18575 }
18576}
18577impl Default for MANUAL_CONTROL_DATA {
18578 fn default() -> Self {
18579 Self::DEFAULT.clone()
18580 }
18581}
18582impl MessageData for MANUAL_CONTROL_DATA {
18583 type Message = MavMessage;
18584 const ID: u32 = 69u32;
18585 const NAME: &'static str = "MANUAL_CONTROL";
18586 const EXTRA_CRC: u8 = 243u8;
18587 const ENCODED_LEN: usize = 30usize;
18588 fn deser(
18589 _version: MavlinkVersion,
18590 __input: &[u8],
18591 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18592 let avail_len = __input.len();
18593 let mut payload_buf = [0; Self::ENCODED_LEN];
18594 let mut buf = if avail_len < Self::ENCODED_LEN {
18595 payload_buf[0..avail_len].copy_from_slice(__input);
18596 Bytes::new(&payload_buf)
18597 } else {
18598 Bytes::new(__input)
18599 };
18600 let mut __struct = Self::default();
18601 __struct.x = buf.get_i16_le();
18602 __struct.y = buf.get_i16_le();
18603 __struct.z = buf.get_i16_le();
18604 __struct.r = buf.get_i16_le();
18605 __struct.buttons = buf.get_u16_le();
18606 __struct.target = buf.get_u8();
18607 __struct.buttons2 = buf.get_u16_le();
18608 __struct.enabled_extensions = buf.get_u8();
18609 __struct.s = buf.get_i16_le();
18610 __struct.t = buf.get_i16_le();
18611 __struct.aux1 = buf.get_i16_le();
18612 __struct.aux2 = buf.get_i16_le();
18613 __struct.aux3 = buf.get_i16_le();
18614 __struct.aux4 = buf.get_i16_le();
18615 __struct.aux5 = buf.get_i16_le();
18616 __struct.aux6 = buf.get_i16_le();
18617 Ok(__struct)
18618 }
18619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18620 let mut __tmp = BytesMut::new(bytes);
18621 #[allow(clippy::absurd_extreme_comparisons)]
18622 #[allow(unused_comparisons)]
18623 if __tmp.remaining() < Self::ENCODED_LEN {
18624 panic!(
18625 "buffer is too small (need {} bytes, but got {})",
18626 Self::ENCODED_LEN,
18627 __tmp.remaining(),
18628 )
18629 }
18630 __tmp.put_i16_le(self.x);
18631 __tmp.put_i16_le(self.y);
18632 __tmp.put_i16_le(self.z);
18633 __tmp.put_i16_le(self.r);
18634 __tmp.put_u16_le(self.buttons);
18635 __tmp.put_u8(self.target);
18636 __tmp.put_u16_le(self.buttons2);
18637 __tmp.put_u8(self.enabled_extensions);
18638 __tmp.put_i16_le(self.s);
18639 __tmp.put_i16_le(self.t);
18640 __tmp.put_i16_le(self.aux1);
18641 __tmp.put_i16_le(self.aux2);
18642 __tmp.put_i16_le(self.aux3);
18643 __tmp.put_i16_le(self.aux4);
18644 __tmp.put_i16_le(self.aux5);
18645 __tmp.put_i16_le(self.aux6);
18646 if matches!(version, MavlinkVersion::V2) {
18647 let len = __tmp.len();
18648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18649 } else {
18650 __tmp.len()
18651 }
18652 }
18653}
18654#[doc = "id: 81"]
18655#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18656#[derive(Debug, Clone, PartialEq)]
18657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18659pub struct MANUAL_SETPOINT_DATA {
18660 #[doc = "Timestamp (time since system boot)."]
18661 pub time_boot_ms: u32,
18662 #[doc = "Desired roll rate"]
18663 pub roll: f32,
18664 #[doc = "Desired pitch rate"]
18665 pub pitch: f32,
18666 #[doc = "Desired yaw rate"]
18667 pub yaw: f32,
18668 #[doc = "Collective thrust, normalized to 0 .. 1"]
18669 pub thrust: f32,
18670 #[doc = "Flight mode switch position, 0.. 255"]
18671 pub mode_switch: u8,
18672 #[doc = "Override mode switch position, 0.. 255"]
18673 pub manual_override_switch: u8,
18674}
18675impl MANUAL_SETPOINT_DATA {
18676 pub const ENCODED_LEN: usize = 22usize;
18677 pub const DEFAULT: Self = Self {
18678 time_boot_ms: 0_u32,
18679 roll: 0.0_f32,
18680 pitch: 0.0_f32,
18681 yaw: 0.0_f32,
18682 thrust: 0.0_f32,
18683 mode_switch: 0_u8,
18684 manual_override_switch: 0_u8,
18685 };
18686 #[cfg(feature = "arbitrary")]
18687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18688 use arbitrary::{Arbitrary, Unstructured};
18689 let mut buf = [0u8; 1024];
18690 rng.fill_bytes(&mut buf);
18691 let mut unstructured = Unstructured::new(&buf);
18692 Self::arbitrary(&mut unstructured).unwrap_or_default()
18693 }
18694}
18695impl Default for MANUAL_SETPOINT_DATA {
18696 fn default() -> Self {
18697 Self::DEFAULT.clone()
18698 }
18699}
18700impl MessageData for MANUAL_SETPOINT_DATA {
18701 type Message = MavMessage;
18702 const ID: u32 = 81u32;
18703 const NAME: &'static str = "MANUAL_SETPOINT";
18704 const EXTRA_CRC: u8 = 106u8;
18705 const ENCODED_LEN: usize = 22usize;
18706 fn deser(
18707 _version: MavlinkVersion,
18708 __input: &[u8],
18709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18710 let avail_len = __input.len();
18711 let mut payload_buf = [0; Self::ENCODED_LEN];
18712 let mut buf = if avail_len < Self::ENCODED_LEN {
18713 payload_buf[0..avail_len].copy_from_slice(__input);
18714 Bytes::new(&payload_buf)
18715 } else {
18716 Bytes::new(__input)
18717 };
18718 let mut __struct = Self::default();
18719 __struct.time_boot_ms = buf.get_u32_le();
18720 __struct.roll = buf.get_f32_le();
18721 __struct.pitch = buf.get_f32_le();
18722 __struct.yaw = buf.get_f32_le();
18723 __struct.thrust = buf.get_f32_le();
18724 __struct.mode_switch = buf.get_u8();
18725 __struct.manual_override_switch = buf.get_u8();
18726 Ok(__struct)
18727 }
18728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18729 let mut __tmp = BytesMut::new(bytes);
18730 #[allow(clippy::absurd_extreme_comparisons)]
18731 #[allow(unused_comparisons)]
18732 if __tmp.remaining() < Self::ENCODED_LEN {
18733 panic!(
18734 "buffer is too small (need {} bytes, but got {})",
18735 Self::ENCODED_LEN,
18736 __tmp.remaining(),
18737 )
18738 }
18739 __tmp.put_u32_le(self.time_boot_ms);
18740 __tmp.put_f32_le(self.roll);
18741 __tmp.put_f32_le(self.pitch);
18742 __tmp.put_f32_le(self.yaw);
18743 __tmp.put_f32_le(self.thrust);
18744 __tmp.put_u8(self.mode_switch);
18745 __tmp.put_u8(self.manual_override_switch);
18746 if matches!(version, MavlinkVersion::V2) {
18747 let len = __tmp.len();
18748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18749 } else {
18750 __tmp.len()
18751 }
18752 }
18753}
18754#[doc = "id: 249"]
18755#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18756#[derive(Debug, Clone, PartialEq)]
18757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18759pub struct MEMORY_VECT_DATA {
18760 #[doc = "Starting address of the debug variables"]
18761 pub address: u16,
18762 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18763 pub ver: u8,
18764 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18765 pub mavtype: u8,
18766 #[doc = "Memory contents at specified address"]
18767 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18768 pub value: [i8; 32],
18769}
18770impl MEMORY_VECT_DATA {
18771 pub const ENCODED_LEN: usize = 36usize;
18772 pub const DEFAULT: Self = Self {
18773 address: 0_u16,
18774 ver: 0_u8,
18775 mavtype: 0_u8,
18776 value: [0_i8; 32usize],
18777 };
18778 #[cfg(feature = "arbitrary")]
18779 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18780 use arbitrary::{Arbitrary, Unstructured};
18781 let mut buf = [0u8; 1024];
18782 rng.fill_bytes(&mut buf);
18783 let mut unstructured = Unstructured::new(&buf);
18784 Self::arbitrary(&mut unstructured).unwrap_or_default()
18785 }
18786}
18787impl Default for MEMORY_VECT_DATA {
18788 fn default() -> Self {
18789 Self::DEFAULT.clone()
18790 }
18791}
18792impl MessageData for MEMORY_VECT_DATA {
18793 type Message = MavMessage;
18794 const ID: u32 = 249u32;
18795 const NAME: &'static str = "MEMORY_VECT";
18796 const EXTRA_CRC: u8 = 204u8;
18797 const ENCODED_LEN: usize = 36usize;
18798 fn deser(
18799 _version: MavlinkVersion,
18800 __input: &[u8],
18801 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18802 let avail_len = __input.len();
18803 let mut payload_buf = [0; Self::ENCODED_LEN];
18804 let mut buf = if avail_len < Self::ENCODED_LEN {
18805 payload_buf[0..avail_len].copy_from_slice(__input);
18806 Bytes::new(&payload_buf)
18807 } else {
18808 Bytes::new(__input)
18809 };
18810 let mut __struct = Self::default();
18811 __struct.address = buf.get_u16_le();
18812 __struct.ver = buf.get_u8();
18813 __struct.mavtype = buf.get_u8();
18814 for v in &mut __struct.value {
18815 let val = buf.get_i8();
18816 *v = val;
18817 }
18818 Ok(__struct)
18819 }
18820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18821 let mut __tmp = BytesMut::new(bytes);
18822 #[allow(clippy::absurd_extreme_comparisons)]
18823 #[allow(unused_comparisons)]
18824 if __tmp.remaining() < Self::ENCODED_LEN {
18825 panic!(
18826 "buffer is too small (need {} bytes, but got {})",
18827 Self::ENCODED_LEN,
18828 __tmp.remaining(),
18829 )
18830 }
18831 __tmp.put_u16_le(self.address);
18832 __tmp.put_u8(self.ver);
18833 __tmp.put_u8(self.mavtype);
18834 for val in &self.value {
18835 __tmp.put_i8(*val);
18836 }
18837 if matches!(version, MavlinkVersion::V2) {
18838 let len = __tmp.len();
18839 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18840 } else {
18841 __tmp.len()
18842 }
18843 }
18844}
18845#[doc = "id: 244"]
18846#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18847#[derive(Debug, Clone, PartialEq)]
18848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18850pub struct MESSAGE_INTERVAL_DATA {
18851 #[doc = "0 indicates the interval at which it is sent."]
18852 pub interval_us: i32,
18853 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18854 pub message_id: u16,
18855}
18856impl MESSAGE_INTERVAL_DATA {
18857 pub const ENCODED_LEN: usize = 6usize;
18858 pub const DEFAULT: Self = Self {
18859 interval_us: 0_i32,
18860 message_id: 0_u16,
18861 };
18862 #[cfg(feature = "arbitrary")]
18863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18864 use arbitrary::{Arbitrary, Unstructured};
18865 let mut buf = [0u8; 1024];
18866 rng.fill_bytes(&mut buf);
18867 let mut unstructured = Unstructured::new(&buf);
18868 Self::arbitrary(&mut unstructured).unwrap_or_default()
18869 }
18870}
18871impl Default for MESSAGE_INTERVAL_DATA {
18872 fn default() -> Self {
18873 Self::DEFAULT.clone()
18874 }
18875}
18876impl MessageData for MESSAGE_INTERVAL_DATA {
18877 type Message = MavMessage;
18878 const ID: u32 = 244u32;
18879 const NAME: &'static str = "MESSAGE_INTERVAL";
18880 const EXTRA_CRC: u8 = 95u8;
18881 const ENCODED_LEN: usize = 6usize;
18882 fn deser(
18883 _version: MavlinkVersion,
18884 __input: &[u8],
18885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18886 let avail_len = __input.len();
18887 let mut payload_buf = [0; Self::ENCODED_LEN];
18888 let mut buf = if avail_len < Self::ENCODED_LEN {
18889 payload_buf[0..avail_len].copy_from_slice(__input);
18890 Bytes::new(&payload_buf)
18891 } else {
18892 Bytes::new(__input)
18893 };
18894 let mut __struct = Self::default();
18895 __struct.interval_us = buf.get_i32_le();
18896 __struct.message_id = buf.get_u16_le();
18897 Ok(__struct)
18898 }
18899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18900 let mut __tmp = BytesMut::new(bytes);
18901 #[allow(clippy::absurd_extreme_comparisons)]
18902 #[allow(unused_comparisons)]
18903 if __tmp.remaining() < Self::ENCODED_LEN {
18904 panic!(
18905 "buffer is too small (need {} bytes, but got {})",
18906 Self::ENCODED_LEN,
18907 __tmp.remaining(),
18908 )
18909 }
18910 __tmp.put_i32_le(self.interval_us);
18911 __tmp.put_u16_le(self.message_id);
18912 if matches!(version, MavlinkVersion::V2) {
18913 let len = __tmp.len();
18914 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18915 } else {
18916 __tmp.len()
18917 }
18918 }
18919}
18920#[doc = "id: 47"]
18921#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18922#[derive(Debug, Clone, PartialEq)]
18923#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18925pub struct MISSION_ACK_DATA {
18926 #[doc = "System ID"]
18927 pub target_system: u8,
18928 #[doc = "Component ID"]
18929 pub target_component: u8,
18930 #[doc = "Mission result."]
18931 pub mavtype: MavMissionResult,
18932 #[doc = "Mission type."]
18933 #[cfg_attr(feature = "serde", serde(default))]
18934 pub mission_type: MavMissionType,
18935 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18936 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18937 pub opaque_id: u32,
18938}
18939impl MISSION_ACK_DATA {
18940 pub const ENCODED_LEN: usize = 8usize;
18941 pub const DEFAULT: Self = Self {
18942 target_system: 0_u8,
18943 target_component: 0_u8,
18944 mavtype: MavMissionResult::DEFAULT,
18945 mission_type: MavMissionType::DEFAULT,
18946 opaque_id: 0_u32,
18947 };
18948 #[cfg(feature = "arbitrary")]
18949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18950 use arbitrary::{Arbitrary, Unstructured};
18951 let mut buf = [0u8; 1024];
18952 rng.fill_bytes(&mut buf);
18953 let mut unstructured = Unstructured::new(&buf);
18954 Self::arbitrary(&mut unstructured).unwrap_or_default()
18955 }
18956}
18957impl Default for MISSION_ACK_DATA {
18958 fn default() -> Self {
18959 Self::DEFAULT.clone()
18960 }
18961}
18962impl MessageData for MISSION_ACK_DATA {
18963 type Message = MavMessage;
18964 const ID: u32 = 47u32;
18965 const NAME: &'static str = "MISSION_ACK";
18966 const EXTRA_CRC: u8 = 153u8;
18967 const ENCODED_LEN: usize = 8usize;
18968 fn deser(
18969 _version: MavlinkVersion,
18970 __input: &[u8],
18971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18972 let avail_len = __input.len();
18973 let mut payload_buf = [0; Self::ENCODED_LEN];
18974 let mut buf = if avail_len < Self::ENCODED_LEN {
18975 payload_buf[0..avail_len].copy_from_slice(__input);
18976 Bytes::new(&payload_buf)
18977 } else {
18978 Bytes::new(__input)
18979 };
18980 let mut __struct = Self::default();
18981 __struct.target_system = buf.get_u8();
18982 __struct.target_component = buf.get_u8();
18983 let tmp = buf.get_u8();
18984 __struct.mavtype =
18985 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18986 enum_type: "MavMissionResult",
18987 value: tmp as u32,
18988 })?;
18989 let tmp = buf.get_u8();
18990 __struct.mission_type =
18991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18992 enum_type: "MavMissionType",
18993 value: tmp as u32,
18994 })?;
18995 __struct.opaque_id = buf.get_u32_le();
18996 Ok(__struct)
18997 }
18998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18999 let mut __tmp = BytesMut::new(bytes);
19000 #[allow(clippy::absurd_extreme_comparisons)]
19001 #[allow(unused_comparisons)]
19002 if __tmp.remaining() < Self::ENCODED_LEN {
19003 panic!(
19004 "buffer is too small (need {} bytes, but got {})",
19005 Self::ENCODED_LEN,
19006 __tmp.remaining(),
19007 )
19008 }
19009 __tmp.put_u8(self.target_system);
19010 __tmp.put_u8(self.target_component);
19011 __tmp.put_u8(self.mavtype as u8);
19012 __tmp.put_u8(self.mission_type as u8);
19013 __tmp.put_u32_le(self.opaque_id);
19014 if matches!(version, MavlinkVersion::V2) {
19015 let len = __tmp.len();
19016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19017 } else {
19018 __tmp.len()
19019 }
19020 }
19021}
19022#[doc = "id: 45"]
19023#[doc = "Delete all mission items at once."]
19024#[derive(Debug, Clone, PartialEq)]
19025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19027pub struct MISSION_CLEAR_ALL_DATA {
19028 #[doc = "System ID"]
19029 pub target_system: u8,
19030 #[doc = "Component ID"]
19031 pub target_component: u8,
19032 #[doc = "Mission type."]
19033 #[cfg_attr(feature = "serde", serde(default))]
19034 pub mission_type: MavMissionType,
19035}
19036impl MISSION_CLEAR_ALL_DATA {
19037 pub const ENCODED_LEN: usize = 3usize;
19038 pub const DEFAULT: Self = Self {
19039 target_system: 0_u8,
19040 target_component: 0_u8,
19041 mission_type: MavMissionType::DEFAULT,
19042 };
19043 #[cfg(feature = "arbitrary")]
19044 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19045 use arbitrary::{Arbitrary, Unstructured};
19046 let mut buf = [0u8; 1024];
19047 rng.fill_bytes(&mut buf);
19048 let mut unstructured = Unstructured::new(&buf);
19049 Self::arbitrary(&mut unstructured).unwrap_or_default()
19050 }
19051}
19052impl Default for MISSION_CLEAR_ALL_DATA {
19053 fn default() -> Self {
19054 Self::DEFAULT.clone()
19055 }
19056}
19057impl MessageData for MISSION_CLEAR_ALL_DATA {
19058 type Message = MavMessage;
19059 const ID: u32 = 45u32;
19060 const NAME: &'static str = "MISSION_CLEAR_ALL";
19061 const EXTRA_CRC: u8 = 232u8;
19062 const ENCODED_LEN: usize = 3usize;
19063 fn deser(
19064 _version: MavlinkVersion,
19065 __input: &[u8],
19066 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19067 let avail_len = __input.len();
19068 let mut payload_buf = [0; Self::ENCODED_LEN];
19069 let mut buf = if avail_len < Self::ENCODED_LEN {
19070 payload_buf[0..avail_len].copy_from_slice(__input);
19071 Bytes::new(&payload_buf)
19072 } else {
19073 Bytes::new(__input)
19074 };
19075 let mut __struct = Self::default();
19076 __struct.target_system = buf.get_u8();
19077 __struct.target_component = buf.get_u8();
19078 let tmp = buf.get_u8();
19079 __struct.mission_type =
19080 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19081 enum_type: "MavMissionType",
19082 value: tmp as u32,
19083 })?;
19084 Ok(__struct)
19085 }
19086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19087 let mut __tmp = BytesMut::new(bytes);
19088 #[allow(clippy::absurd_extreme_comparisons)]
19089 #[allow(unused_comparisons)]
19090 if __tmp.remaining() < Self::ENCODED_LEN {
19091 panic!(
19092 "buffer is too small (need {} bytes, but got {})",
19093 Self::ENCODED_LEN,
19094 __tmp.remaining(),
19095 )
19096 }
19097 __tmp.put_u8(self.target_system);
19098 __tmp.put_u8(self.target_component);
19099 __tmp.put_u8(self.mission_type as u8);
19100 if matches!(version, MavlinkVersion::V2) {
19101 let len = __tmp.len();
19102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19103 } else {
19104 __tmp.len()
19105 }
19106 }
19107}
19108#[doc = "id: 44"]
19109#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19110#[derive(Debug, Clone, PartialEq)]
19111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19113pub struct MISSION_COUNT_DATA {
19114 #[doc = "Number of mission items in the sequence"]
19115 pub count: u16,
19116 #[doc = "System ID"]
19117 pub target_system: u8,
19118 #[doc = "Component ID"]
19119 pub target_component: u8,
19120 #[doc = "Mission type."]
19121 #[cfg_attr(feature = "serde", serde(default))]
19122 pub mission_type: MavMissionType,
19123 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19124 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19125 pub opaque_id: u32,
19126}
19127impl MISSION_COUNT_DATA {
19128 pub const ENCODED_LEN: usize = 9usize;
19129 pub const DEFAULT: Self = Self {
19130 count: 0_u16,
19131 target_system: 0_u8,
19132 target_component: 0_u8,
19133 mission_type: MavMissionType::DEFAULT,
19134 opaque_id: 0_u32,
19135 };
19136 #[cfg(feature = "arbitrary")]
19137 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19138 use arbitrary::{Arbitrary, Unstructured};
19139 let mut buf = [0u8; 1024];
19140 rng.fill_bytes(&mut buf);
19141 let mut unstructured = Unstructured::new(&buf);
19142 Self::arbitrary(&mut unstructured).unwrap_or_default()
19143 }
19144}
19145impl Default for MISSION_COUNT_DATA {
19146 fn default() -> Self {
19147 Self::DEFAULT.clone()
19148 }
19149}
19150impl MessageData for MISSION_COUNT_DATA {
19151 type Message = MavMessage;
19152 const ID: u32 = 44u32;
19153 const NAME: &'static str = "MISSION_COUNT";
19154 const EXTRA_CRC: u8 = 221u8;
19155 const ENCODED_LEN: usize = 9usize;
19156 fn deser(
19157 _version: MavlinkVersion,
19158 __input: &[u8],
19159 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19160 let avail_len = __input.len();
19161 let mut payload_buf = [0; Self::ENCODED_LEN];
19162 let mut buf = if avail_len < Self::ENCODED_LEN {
19163 payload_buf[0..avail_len].copy_from_slice(__input);
19164 Bytes::new(&payload_buf)
19165 } else {
19166 Bytes::new(__input)
19167 };
19168 let mut __struct = Self::default();
19169 __struct.count = buf.get_u16_le();
19170 __struct.target_system = buf.get_u8();
19171 __struct.target_component = buf.get_u8();
19172 let tmp = buf.get_u8();
19173 __struct.mission_type =
19174 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19175 enum_type: "MavMissionType",
19176 value: tmp as u32,
19177 })?;
19178 __struct.opaque_id = buf.get_u32_le();
19179 Ok(__struct)
19180 }
19181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19182 let mut __tmp = BytesMut::new(bytes);
19183 #[allow(clippy::absurd_extreme_comparisons)]
19184 #[allow(unused_comparisons)]
19185 if __tmp.remaining() < Self::ENCODED_LEN {
19186 panic!(
19187 "buffer is too small (need {} bytes, but got {})",
19188 Self::ENCODED_LEN,
19189 __tmp.remaining(),
19190 )
19191 }
19192 __tmp.put_u16_le(self.count);
19193 __tmp.put_u8(self.target_system);
19194 __tmp.put_u8(self.target_component);
19195 __tmp.put_u8(self.mission_type as u8);
19196 __tmp.put_u32_le(self.opaque_id);
19197 if matches!(version, MavlinkVersion::V2) {
19198 let len = __tmp.len();
19199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19200 } else {
19201 __tmp.len()
19202 }
19203 }
19204}
19205#[doc = "id: 42"]
19206#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19207#[derive(Debug, Clone, PartialEq)]
19208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19210pub struct MISSION_CURRENT_DATA {
19211 #[doc = "Sequence"]
19212 pub seq: u16,
19213 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19214 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19215 pub total: u16,
19216 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19217 #[cfg_attr(feature = "serde", serde(default))]
19218 pub mission_state: MissionState,
19219 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19220 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19221 pub mission_mode: u8,
19222 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19223 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19224 pub mission_id: u32,
19225 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19226 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19227 pub fence_id: u32,
19228 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19229 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19230 pub rally_points_id: u32,
19231}
19232impl MISSION_CURRENT_DATA {
19233 pub const ENCODED_LEN: usize = 18usize;
19234 pub const DEFAULT: Self = Self {
19235 seq: 0_u16,
19236 total: 0_u16,
19237 mission_state: MissionState::DEFAULT,
19238 mission_mode: 0_u8,
19239 mission_id: 0_u32,
19240 fence_id: 0_u32,
19241 rally_points_id: 0_u32,
19242 };
19243 #[cfg(feature = "arbitrary")]
19244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19245 use arbitrary::{Arbitrary, Unstructured};
19246 let mut buf = [0u8; 1024];
19247 rng.fill_bytes(&mut buf);
19248 let mut unstructured = Unstructured::new(&buf);
19249 Self::arbitrary(&mut unstructured).unwrap_or_default()
19250 }
19251}
19252impl Default for MISSION_CURRENT_DATA {
19253 fn default() -> Self {
19254 Self::DEFAULT.clone()
19255 }
19256}
19257impl MessageData for MISSION_CURRENT_DATA {
19258 type Message = MavMessage;
19259 const ID: u32 = 42u32;
19260 const NAME: &'static str = "MISSION_CURRENT";
19261 const EXTRA_CRC: u8 = 28u8;
19262 const ENCODED_LEN: usize = 18usize;
19263 fn deser(
19264 _version: MavlinkVersion,
19265 __input: &[u8],
19266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19267 let avail_len = __input.len();
19268 let mut payload_buf = [0; Self::ENCODED_LEN];
19269 let mut buf = if avail_len < Self::ENCODED_LEN {
19270 payload_buf[0..avail_len].copy_from_slice(__input);
19271 Bytes::new(&payload_buf)
19272 } else {
19273 Bytes::new(__input)
19274 };
19275 let mut __struct = Self::default();
19276 __struct.seq = buf.get_u16_le();
19277 __struct.total = buf.get_u16_le();
19278 let tmp = buf.get_u8();
19279 __struct.mission_state =
19280 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19281 enum_type: "MissionState",
19282 value: tmp as u32,
19283 })?;
19284 __struct.mission_mode = buf.get_u8();
19285 __struct.mission_id = buf.get_u32_le();
19286 __struct.fence_id = buf.get_u32_le();
19287 __struct.rally_points_id = buf.get_u32_le();
19288 Ok(__struct)
19289 }
19290 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19291 let mut __tmp = BytesMut::new(bytes);
19292 #[allow(clippy::absurd_extreme_comparisons)]
19293 #[allow(unused_comparisons)]
19294 if __tmp.remaining() < Self::ENCODED_LEN {
19295 panic!(
19296 "buffer is too small (need {} bytes, but got {})",
19297 Self::ENCODED_LEN,
19298 __tmp.remaining(),
19299 )
19300 }
19301 __tmp.put_u16_le(self.seq);
19302 __tmp.put_u16_le(self.total);
19303 __tmp.put_u8(self.mission_state as u8);
19304 __tmp.put_u8(self.mission_mode);
19305 __tmp.put_u32_le(self.mission_id);
19306 __tmp.put_u32_le(self.fence_id);
19307 __tmp.put_u32_le(self.rally_points_id);
19308 if matches!(version, MavlinkVersion::V2) {
19309 let len = __tmp.len();
19310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19311 } else {
19312 __tmp.len()
19313 }
19314 }
19315}
19316#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19317#[doc = "id: 39"]
19318#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19319#[derive(Debug, Clone, PartialEq)]
19320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19322pub struct MISSION_ITEM_DATA {
19323 #[doc = "PARAM1, see MAV_CMD enum"]
19324 pub param1: f32,
19325 #[doc = "PARAM2, see MAV_CMD enum"]
19326 pub param2: f32,
19327 #[doc = "PARAM3, see MAV_CMD enum"]
19328 pub param3: f32,
19329 #[doc = "PARAM4, see MAV_CMD enum"]
19330 pub param4: f32,
19331 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19332 pub x: f32,
19333 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19334 pub y: f32,
19335 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19336 pub z: f32,
19337 #[doc = "Sequence"]
19338 pub seq: u16,
19339 #[doc = "The scheduled action for the waypoint."]
19340 pub command: MavCmd,
19341 #[doc = "System ID"]
19342 pub target_system: u8,
19343 #[doc = "Component ID"]
19344 pub target_component: u8,
19345 #[doc = "The coordinate system of the waypoint."]
19346 pub frame: MavFrame,
19347 #[doc = "false:0, true:1"]
19348 pub current: u8,
19349 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19350 pub autocontinue: u8,
19351 #[doc = "Mission type."]
19352 #[cfg_attr(feature = "serde", serde(default))]
19353 pub mission_type: MavMissionType,
19354}
19355impl MISSION_ITEM_DATA {
19356 pub const ENCODED_LEN: usize = 38usize;
19357 pub const DEFAULT: Self = Self {
19358 param1: 0.0_f32,
19359 param2: 0.0_f32,
19360 param3: 0.0_f32,
19361 param4: 0.0_f32,
19362 x: 0.0_f32,
19363 y: 0.0_f32,
19364 z: 0.0_f32,
19365 seq: 0_u16,
19366 command: MavCmd::DEFAULT,
19367 target_system: 0_u8,
19368 target_component: 0_u8,
19369 frame: MavFrame::DEFAULT,
19370 current: 0_u8,
19371 autocontinue: 0_u8,
19372 mission_type: MavMissionType::DEFAULT,
19373 };
19374 #[cfg(feature = "arbitrary")]
19375 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19376 use arbitrary::{Arbitrary, Unstructured};
19377 let mut buf = [0u8; 1024];
19378 rng.fill_bytes(&mut buf);
19379 let mut unstructured = Unstructured::new(&buf);
19380 Self::arbitrary(&mut unstructured).unwrap_or_default()
19381 }
19382}
19383impl Default for MISSION_ITEM_DATA {
19384 fn default() -> Self {
19385 Self::DEFAULT.clone()
19386 }
19387}
19388impl MessageData for MISSION_ITEM_DATA {
19389 type Message = MavMessage;
19390 const ID: u32 = 39u32;
19391 const NAME: &'static str = "MISSION_ITEM";
19392 const EXTRA_CRC: u8 = 254u8;
19393 const ENCODED_LEN: usize = 38usize;
19394 fn deser(
19395 _version: MavlinkVersion,
19396 __input: &[u8],
19397 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19398 let avail_len = __input.len();
19399 let mut payload_buf = [0; Self::ENCODED_LEN];
19400 let mut buf = if avail_len < Self::ENCODED_LEN {
19401 payload_buf[0..avail_len].copy_from_slice(__input);
19402 Bytes::new(&payload_buf)
19403 } else {
19404 Bytes::new(__input)
19405 };
19406 let mut __struct = Self::default();
19407 __struct.param1 = buf.get_f32_le();
19408 __struct.param2 = buf.get_f32_le();
19409 __struct.param3 = buf.get_f32_le();
19410 __struct.param4 = buf.get_f32_le();
19411 __struct.x = buf.get_f32_le();
19412 __struct.y = buf.get_f32_le();
19413 __struct.z = buf.get_f32_le();
19414 __struct.seq = buf.get_u16_le();
19415 let tmp = buf.get_u16_le();
19416 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19417 ::mavlink_core::error::ParserError::InvalidEnum {
19418 enum_type: "MavCmd",
19419 value: tmp as u32,
19420 },
19421 )?;
19422 __struct.target_system = buf.get_u8();
19423 __struct.target_component = buf.get_u8();
19424 let tmp = buf.get_u8();
19425 __struct.frame =
19426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19427 enum_type: "MavFrame",
19428 value: tmp as u32,
19429 })?;
19430 __struct.current = buf.get_u8();
19431 __struct.autocontinue = buf.get_u8();
19432 let tmp = buf.get_u8();
19433 __struct.mission_type =
19434 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19435 enum_type: "MavMissionType",
19436 value: tmp as u32,
19437 })?;
19438 Ok(__struct)
19439 }
19440 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19441 let mut __tmp = BytesMut::new(bytes);
19442 #[allow(clippy::absurd_extreme_comparisons)]
19443 #[allow(unused_comparisons)]
19444 if __tmp.remaining() < Self::ENCODED_LEN {
19445 panic!(
19446 "buffer is too small (need {} bytes, but got {})",
19447 Self::ENCODED_LEN,
19448 __tmp.remaining(),
19449 )
19450 }
19451 __tmp.put_f32_le(self.param1);
19452 __tmp.put_f32_le(self.param2);
19453 __tmp.put_f32_le(self.param3);
19454 __tmp.put_f32_le(self.param4);
19455 __tmp.put_f32_le(self.x);
19456 __tmp.put_f32_le(self.y);
19457 __tmp.put_f32_le(self.z);
19458 __tmp.put_u16_le(self.seq);
19459 __tmp.put_u16_le(self.command as u16);
19460 __tmp.put_u8(self.target_system);
19461 __tmp.put_u8(self.target_component);
19462 __tmp.put_u8(self.frame as u8);
19463 __tmp.put_u8(self.current);
19464 __tmp.put_u8(self.autocontinue);
19465 __tmp.put_u8(self.mission_type as u8);
19466 if matches!(version, MavlinkVersion::V2) {
19467 let len = __tmp.len();
19468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19469 } else {
19470 __tmp.len()
19471 }
19472 }
19473}
19474#[doc = "id: 73"]
19475#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19476#[derive(Debug, Clone, PartialEq)]
19477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19479pub struct MISSION_ITEM_INT_DATA {
19480 #[doc = "PARAM1, see MAV_CMD enum"]
19481 pub param1: f32,
19482 #[doc = "PARAM2, see MAV_CMD enum"]
19483 pub param2: f32,
19484 #[doc = "PARAM3, see MAV_CMD enum"]
19485 pub param3: f32,
19486 #[doc = "PARAM4, see MAV_CMD enum"]
19487 pub param4: f32,
19488 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19489 pub x: i32,
19490 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19491 pub y: i32,
19492 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19493 pub z: f32,
19494 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19495 pub seq: u16,
19496 #[doc = "The scheduled action for the waypoint."]
19497 pub command: MavCmd,
19498 #[doc = "System ID"]
19499 pub target_system: u8,
19500 #[doc = "Component ID"]
19501 pub target_component: u8,
19502 #[doc = "The coordinate system of the waypoint."]
19503 pub frame: MavFrame,
19504 #[doc = "false:0, true:1"]
19505 pub current: u8,
19506 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19507 pub autocontinue: u8,
19508 #[doc = "Mission type."]
19509 #[cfg_attr(feature = "serde", serde(default))]
19510 pub mission_type: MavMissionType,
19511}
19512impl MISSION_ITEM_INT_DATA {
19513 pub const ENCODED_LEN: usize = 38usize;
19514 pub const DEFAULT: Self = Self {
19515 param1: 0.0_f32,
19516 param2: 0.0_f32,
19517 param3: 0.0_f32,
19518 param4: 0.0_f32,
19519 x: 0_i32,
19520 y: 0_i32,
19521 z: 0.0_f32,
19522 seq: 0_u16,
19523 command: MavCmd::DEFAULT,
19524 target_system: 0_u8,
19525 target_component: 0_u8,
19526 frame: MavFrame::DEFAULT,
19527 current: 0_u8,
19528 autocontinue: 0_u8,
19529 mission_type: MavMissionType::DEFAULT,
19530 };
19531 #[cfg(feature = "arbitrary")]
19532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19533 use arbitrary::{Arbitrary, Unstructured};
19534 let mut buf = [0u8; 1024];
19535 rng.fill_bytes(&mut buf);
19536 let mut unstructured = Unstructured::new(&buf);
19537 Self::arbitrary(&mut unstructured).unwrap_or_default()
19538 }
19539}
19540impl Default for MISSION_ITEM_INT_DATA {
19541 fn default() -> Self {
19542 Self::DEFAULT.clone()
19543 }
19544}
19545impl MessageData for MISSION_ITEM_INT_DATA {
19546 type Message = MavMessage;
19547 const ID: u32 = 73u32;
19548 const NAME: &'static str = "MISSION_ITEM_INT";
19549 const EXTRA_CRC: u8 = 38u8;
19550 const ENCODED_LEN: usize = 38usize;
19551 fn deser(
19552 _version: MavlinkVersion,
19553 __input: &[u8],
19554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19555 let avail_len = __input.len();
19556 let mut payload_buf = [0; Self::ENCODED_LEN];
19557 let mut buf = if avail_len < Self::ENCODED_LEN {
19558 payload_buf[0..avail_len].copy_from_slice(__input);
19559 Bytes::new(&payload_buf)
19560 } else {
19561 Bytes::new(__input)
19562 };
19563 let mut __struct = Self::default();
19564 __struct.param1 = buf.get_f32_le();
19565 __struct.param2 = buf.get_f32_le();
19566 __struct.param3 = buf.get_f32_le();
19567 __struct.param4 = buf.get_f32_le();
19568 __struct.x = buf.get_i32_le();
19569 __struct.y = buf.get_i32_le();
19570 __struct.z = buf.get_f32_le();
19571 __struct.seq = buf.get_u16_le();
19572 let tmp = buf.get_u16_le();
19573 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19574 ::mavlink_core::error::ParserError::InvalidEnum {
19575 enum_type: "MavCmd",
19576 value: tmp as u32,
19577 },
19578 )?;
19579 __struct.target_system = buf.get_u8();
19580 __struct.target_component = buf.get_u8();
19581 let tmp = buf.get_u8();
19582 __struct.frame =
19583 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19584 enum_type: "MavFrame",
19585 value: tmp as u32,
19586 })?;
19587 __struct.current = buf.get_u8();
19588 __struct.autocontinue = buf.get_u8();
19589 let tmp = buf.get_u8();
19590 __struct.mission_type =
19591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19592 enum_type: "MavMissionType",
19593 value: tmp as u32,
19594 })?;
19595 Ok(__struct)
19596 }
19597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19598 let mut __tmp = BytesMut::new(bytes);
19599 #[allow(clippy::absurd_extreme_comparisons)]
19600 #[allow(unused_comparisons)]
19601 if __tmp.remaining() < Self::ENCODED_LEN {
19602 panic!(
19603 "buffer is too small (need {} bytes, but got {})",
19604 Self::ENCODED_LEN,
19605 __tmp.remaining(),
19606 )
19607 }
19608 __tmp.put_f32_le(self.param1);
19609 __tmp.put_f32_le(self.param2);
19610 __tmp.put_f32_le(self.param3);
19611 __tmp.put_f32_le(self.param4);
19612 __tmp.put_i32_le(self.x);
19613 __tmp.put_i32_le(self.y);
19614 __tmp.put_f32_le(self.z);
19615 __tmp.put_u16_le(self.seq);
19616 __tmp.put_u16_le(self.command as u16);
19617 __tmp.put_u8(self.target_system);
19618 __tmp.put_u8(self.target_component);
19619 __tmp.put_u8(self.frame as u8);
19620 __tmp.put_u8(self.current);
19621 __tmp.put_u8(self.autocontinue);
19622 __tmp.put_u8(self.mission_type as u8);
19623 if matches!(version, MavlinkVersion::V2) {
19624 let len = __tmp.len();
19625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19626 } else {
19627 __tmp.len()
19628 }
19629 }
19630}
19631#[doc = "id: 46"]
19632#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19633#[derive(Debug, Clone, PartialEq)]
19634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19636pub struct MISSION_ITEM_REACHED_DATA {
19637 #[doc = "Sequence"]
19638 pub seq: u16,
19639}
19640impl MISSION_ITEM_REACHED_DATA {
19641 pub const ENCODED_LEN: usize = 2usize;
19642 pub const DEFAULT: Self = Self { seq: 0_u16 };
19643 #[cfg(feature = "arbitrary")]
19644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19645 use arbitrary::{Arbitrary, Unstructured};
19646 let mut buf = [0u8; 1024];
19647 rng.fill_bytes(&mut buf);
19648 let mut unstructured = Unstructured::new(&buf);
19649 Self::arbitrary(&mut unstructured).unwrap_or_default()
19650 }
19651}
19652impl Default for MISSION_ITEM_REACHED_DATA {
19653 fn default() -> Self {
19654 Self::DEFAULT.clone()
19655 }
19656}
19657impl MessageData for MISSION_ITEM_REACHED_DATA {
19658 type Message = MavMessage;
19659 const ID: u32 = 46u32;
19660 const NAME: &'static str = "MISSION_ITEM_REACHED";
19661 const EXTRA_CRC: u8 = 11u8;
19662 const ENCODED_LEN: usize = 2usize;
19663 fn deser(
19664 _version: MavlinkVersion,
19665 __input: &[u8],
19666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19667 let avail_len = __input.len();
19668 let mut payload_buf = [0; Self::ENCODED_LEN];
19669 let mut buf = if avail_len < Self::ENCODED_LEN {
19670 payload_buf[0..avail_len].copy_from_slice(__input);
19671 Bytes::new(&payload_buf)
19672 } else {
19673 Bytes::new(__input)
19674 };
19675 let mut __struct = Self::default();
19676 __struct.seq = buf.get_u16_le();
19677 Ok(__struct)
19678 }
19679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19680 let mut __tmp = BytesMut::new(bytes);
19681 #[allow(clippy::absurd_extreme_comparisons)]
19682 #[allow(unused_comparisons)]
19683 if __tmp.remaining() < Self::ENCODED_LEN {
19684 panic!(
19685 "buffer is too small (need {} bytes, but got {})",
19686 Self::ENCODED_LEN,
19687 __tmp.remaining(),
19688 )
19689 }
19690 __tmp.put_u16_le(self.seq);
19691 if matches!(version, MavlinkVersion::V2) {
19692 let len = __tmp.len();
19693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19694 } else {
19695 __tmp.len()
19696 }
19697 }
19698}
19699#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19700#[doc = "id: 40"]
19701#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19702#[derive(Debug, Clone, PartialEq)]
19703#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19705pub struct MISSION_REQUEST_DATA {
19706 #[doc = "Sequence"]
19707 pub seq: u16,
19708 #[doc = "System ID"]
19709 pub target_system: u8,
19710 #[doc = "Component ID"]
19711 pub target_component: u8,
19712 #[doc = "Mission type."]
19713 #[cfg_attr(feature = "serde", serde(default))]
19714 pub mission_type: MavMissionType,
19715}
19716impl MISSION_REQUEST_DATA {
19717 pub const ENCODED_LEN: usize = 5usize;
19718 pub const DEFAULT: Self = Self {
19719 seq: 0_u16,
19720 target_system: 0_u8,
19721 target_component: 0_u8,
19722 mission_type: MavMissionType::DEFAULT,
19723 };
19724 #[cfg(feature = "arbitrary")]
19725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19726 use arbitrary::{Arbitrary, Unstructured};
19727 let mut buf = [0u8; 1024];
19728 rng.fill_bytes(&mut buf);
19729 let mut unstructured = Unstructured::new(&buf);
19730 Self::arbitrary(&mut unstructured).unwrap_or_default()
19731 }
19732}
19733impl Default for MISSION_REQUEST_DATA {
19734 fn default() -> Self {
19735 Self::DEFAULT.clone()
19736 }
19737}
19738impl MessageData for MISSION_REQUEST_DATA {
19739 type Message = MavMessage;
19740 const ID: u32 = 40u32;
19741 const NAME: &'static str = "MISSION_REQUEST";
19742 const EXTRA_CRC: u8 = 230u8;
19743 const ENCODED_LEN: usize = 5usize;
19744 fn deser(
19745 _version: MavlinkVersion,
19746 __input: &[u8],
19747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19748 let avail_len = __input.len();
19749 let mut payload_buf = [0; Self::ENCODED_LEN];
19750 let mut buf = if avail_len < Self::ENCODED_LEN {
19751 payload_buf[0..avail_len].copy_from_slice(__input);
19752 Bytes::new(&payload_buf)
19753 } else {
19754 Bytes::new(__input)
19755 };
19756 let mut __struct = Self::default();
19757 __struct.seq = buf.get_u16_le();
19758 __struct.target_system = buf.get_u8();
19759 __struct.target_component = buf.get_u8();
19760 let tmp = buf.get_u8();
19761 __struct.mission_type =
19762 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19763 enum_type: "MavMissionType",
19764 value: tmp as u32,
19765 })?;
19766 Ok(__struct)
19767 }
19768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19769 let mut __tmp = BytesMut::new(bytes);
19770 #[allow(clippy::absurd_extreme_comparisons)]
19771 #[allow(unused_comparisons)]
19772 if __tmp.remaining() < Self::ENCODED_LEN {
19773 panic!(
19774 "buffer is too small (need {} bytes, but got {})",
19775 Self::ENCODED_LEN,
19776 __tmp.remaining(),
19777 )
19778 }
19779 __tmp.put_u16_le(self.seq);
19780 __tmp.put_u8(self.target_system);
19781 __tmp.put_u8(self.target_component);
19782 __tmp.put_u8(self.mission_type as u8);
19783 if matches!(version, MavlinkVersion::V2) {
19784 let len = __tmp.len();
19785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19786 } else {
19787 __tmp.len()
19788 }
19789 }
19790}
19791#[doc = "id: 51"]
19792#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19793#[derive(Debug, Clone, PartialEq)]
19794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19796pub struct MISSION_REQUEST_INT_DATA {
19797 #[doc = "Sequence"]
19798 pub seq: u16,
19799 #[doc = "System ID"]
19800 pub target_system: u8,
19801 #[doc = "Component ID"]
19802 pub target_component: u8,
19803 #[doc = "Mission type."]
19804 #[cfg_attr(feature = "serde", serde(default))]
19805 pub mission_type: MavMissionType,
19806}
19807impl MISSION_REQUEST_INT_DATA {
19808 pub const ENCODED_LEN: usize = 5usize;
19809 pub const DEFAULT: Self = Self {
19810 seq: 0_u16,
19811 target_system: 0_u8,
19812 target_component: 0_u8,
19813 mission_type: MavMissionType::DEFAULT,
19814 };
19815 #[cfg(feature = "arbitrary")]
19816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19817 use arbitrary::{Arbitrary, Unstructured};
19818 let mut buf = [0u8; 1024];
19819 rng.fill_bytes(&mut buf);
19820 let mut unstructured = Unstructured::new(&buf);
19821 Self::arbitrary(&mut unstructured).unwrap_or_default()
19822 }
19823}
19824impl Default for MISSION_REQUEST_INT_DATA {
19825 fn default() -> Self {
19826 Self::DEFAULT.clone()
19827 }
19828}
19829impl MessageData for MISSION_REQUEST_INT_DATA {
19830 type Message = MavMessage;
19831 const ID: u32 = 51u32;
19832 const NAME: &'static str = "MISSION_REQUEST_INT";
19833 const EXTRA_CRC: u8 = 196u8;
19834 const ENCODED_LEN: usize = 5usize;
19835 fn deser(
19836 _version: MavlinkVersion,
19837 __input: &[u8],
19838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19839 let avail_len = __input.len();
19840 let mut payload_buf = [0; Self::ENCODED_LEN];
19841 let mut buf = if avail_len < Self::ENCODED_LEN {
19842 payload_buf[0..avail_len].copy_from_slice(__input);
19843 Bytes::new(&payload_buf)
19844 } else {
19845 Bytes::new(__input)
19846 };
19847 let mut __struct = Self::default();
19848 __struct.seq = buf.get_u16_le();
19849 __struct.target_system = buf.get_u8();
19850 __struct.target_component = buf.get_u8();
19851 let tmp = buf.get_u8();
19852 __struct.mission_type =
19853 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19854 enum_type: "MavMissionType",
19855 value: tmp as u32,
19856 })?;
19857 Ok(__struct)
19858 }
19859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19860 let mut __tmp = BytesMut::new(bytes);
19861 #[allow(clippy::absurd_extreme_comparisons)]
19862 #[allow(unused_comparisons)]
19863 if __tmp.remaining() < Self::ENCODED_LEN {
19864 panic!(
19865 "buffer is too small (need {} bytes, but got {})",
19866 Self::ENCODED_LEN,
19867 __tmp.remaining(),
19868 )
19869 }
19870 __tmp.put_u16_le(self.seq);
19871 __tmp.put_u8(self.target_system);
19872 __tmp.put_u8(self.target_component);
19873 __tmp.put_u8(self.mission_type as u8);
19874 if matches!(version, MavlinkVersion::V2) {
19875 let len = __tmp.len();
19876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19877 } else {
19878 __tmp.len()
19879 }
19880 }
19881}
19882#[doc = "id: 43"]
19883#[doc = "Request the overall list of mission items from the system/component."]
19884#[derive(Debug, Clone, PartialEq)]
19885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19887pub struct MISSION_REQUEST_LIST_DATA {
19888 #[doc = "System ID"]
19889 pub target_system: u8,
19890 #[doc = "Component ID"]
19891 pub target_component: u8,
19892 #[doc = "Mission type."]
19893 #[cfg_attr(feature = "serde", serde(default))]
19894 pub mission_type: MavMissionType,
19895}
19896impl MISSION_REQUEST_LIST_DATA {
19897 pub const ENCODED_LEN: usize = 3usize;
19898 pub const DEFAULT: Self = Self {
19899 target_system: 0_u8,
19900 target_component: 0_u8,
19901 mission_type: MavMissionType::DEFAULT,
19902 };
19903 #[cfg(feature = "arbitrary")]
19904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19905 use arbitrary::{Arbitrary, Unstructured};
19906 let mut buf = [0u8; 1024];
19907 rng.fill_bytes(&mut buf);
19908 let mut unstructured = Unstructured::new(&buf);
19909 Self::arbitrary(&mut unstructured).unwrap_or_default()
19910 }
19911}
19912impl Default for MISSION_REQUEST_LIST_DATA {
19913 fn default() -> Self {
19914 Self::DEFAULT.clone()
19915 }
19916}
19917impl MessageData for MISSION_REQUEST_LIST_DATA {
19918 type Message = MavMessage;
19919 const ID: u32 = 43u32;
19920 const NAME: &'static str = "MISSION_REQUEST_LIST";
19921 const EXTRA_CRC: u8 = 132u8;
19922 const ENCODED_LEN: usize = 3usize;
19923 fn deser(
19924 _version: MavlinkVersion,
19925 __input: &[u8],
19926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19927 let avail_len = __input.len();
19928 let mut payload_buf = [0; Self::ENCODED_LEN];
19929 let mut buf = if avail_len < Self::ENCODED_LEN {
19930 payload_buf[0..avail_len].copy_from_slice(__input);
19931 Bytes::new(&payload_buf)
19932 } else {
19933 Bytes::new(__input)
19934 };
19935 let mut __struct = Self::default();
19936 __struct.target_system = buf.get_u8();
19937 __struct.target_component = buf.get_u8();
19938 let tmp = buf.get_u8();
19939 __struct.mission_type =
19940 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19941 enum_type: "MavMissionType",
19942 value: tmp as u32,
19943 })?;
19944 Ok(__struct)
19945 }
19946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19947 let mut __tmp = BytesMut::new(bytes);
19948 #[allow(clippy::absurd_extreme_comparisons)]
19949 #[allow(unused_comparisons)]
19950 if __tmp.remaining() < Self::ENCODED_LEN {
19951 panic!(
19952 "buffer is too small (need {} bytes, but got {})",
19953 Self::ENCODED_LEN,
19954 __tmp.remaining(),
19955 )
19956 }
19957 __tmp.put_u8(self.target_system);
19958 __tmp.put_u8(self.target_component);
19959 __tmp.put_u8(self.mission_type as u8);
19960 if matches!(version, MavlinkVersion::V2) {
19961 let len = __tmp.len();
19962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19963 } else {
19964 __tmp.len()
19965 }
19966 }
19967}
19968#[doc = "id: 37"]
19969#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19970#[derive(Debug, Clone, PartialEq)]
19971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19973pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19974 #[doc = "Start index"]
19975 pub start_index: i16,
19976 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19977 pub end_index: i16,
19978 #[doc = "System ID"]
19979 pub target_system: u8,
19980 #[doc = "Component ID"]
19981 pub target_component: u8,
19982 #[doc = "Mission type."]
19983 #[cfg_attr(feature = "serde", serde(default))]
19984 pub mission_type: MavMissionType,
19985}
19986impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19987 pub const ENCODED_LEN: usize = 7usize;
19988 pub const DEFAULT: Self = Self {
19989 start_index: 0_i16,
19990 end_index: 0_i16,
19991 target_system: 0_u8,
19992 target_component: 0_u8,
19993 mission_type: MavMissionType::DEFAULT,
19994 };
19995 #[cfg(feature = "arbitrary")]
19996 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19997 use arbitrary::{Arbitrary, Unstructured};
19998 let mut buf = [0u8; 1024];
19999 rng.fill_bytes(&mut buf);
20000 let mut unstructured = Unstructured::new(&buf);
20001 Self::arbitrary(&mut unstructured).unwrap_or_default()
20002 }
20003}
20004impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20005 fn default() -> Self {
20006 Self::DEFAULT.clone()
20007 }
20008}
20009impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20010 type Message = MavMessage;
20011 const ID: u32 = 37u32;
20012 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20013 const EXTRA_CRC: u8 = 212u8;
20014 const ENCODED_LEN: usize = 7usize;
20015 fn deser(
20016 _version: MavlinkVersion,
20017 __input: &[u8],
20018 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20019 let avail_len = __input.len();
20020 let mut payload_buf = [0; Self::ENCODED_LEN];
20021 let mut buf = if avail_len < Self::ENCODED_LEN {
20022 payload_buf[0..avail_len].copy_from_slice(__input);
20023 Bytes::new(&payload_buf)
20024 } else {
20025 Bytes::new(__input)
20026 };
20027 let mut __struct = Self::default();
20028 __struct.start_index = buf.get_i16_le();
20029 __struct.end_index = buf.get_i16_le();
20030 __struct.target_system = buf.get_u8();
20031 __struct.target_component = buf.get_u8();
20032 let tmp = buf.get_u8();
20033 __struct.mission_type =
20034 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20035 enum_type: "MavMissionType",
20036 value: tmp as u32,
20037 })?;
20038 Ok(__struct)
20039 }
20040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20041 let mut __tmp = BytesMut::new(bytes);
20042 #[allow(clippy::absurd_extreme_comparisons)]
20043 #[allow(unused_comparisons)]
20044 if __tmp.remaining() < Self::ENCODED_LEN {
20045 panic!(
20046 "buffer is too small (need {} bytes, but got {})",
20047 Self::ENCODED_LEN,
20048 __tmp.remaining(),
20049 )
20050 }
20051 __tmp.put_i16_le(self.start_index);
20052 __tmp.put_i16_le(self.end_index);
20053 __tmp.put_u8(self.target_system);
20054 __tmp.put_u8(self.target_component);
20055 __tmp.put_u8(self.mission_type as u8);
20056 if matches!(version, MavlinkVersion::V2) {
20057 let len = __tmp.len();
20058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20059 } else {
20060 __tmp.len()
20061 }
20062 }
20063}
20064#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20065#[doc = "id: 41"]
20066#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20067#[derive(Debug, Clone, PartialEq)]
20068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20070pub struct MISSION_SET_CURRENT_DATA {
20071 #[doc = "Sequence"]
20072 pub seq: u16,
20073 #[doc = "System ID"]
20074 pub target_system: u8,
20075 #[doc = "Component ID"]
20076 pub target_component: u8,
20077}
20078impl MISSION_SET_CURRENT_DATA {
20079 pub const ENCODED_LEN: usize = 4usize;
20080 pub const DEFAULT: Self = Self {
20081 seq: 0_u16,
20082 target_system: 0_u8,
20083 target_component: 0_u8,
20084 };
20085 #[cfg(feature = "arbitrary")]
20086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20087 use arbitrary::{Arbitrary, Unstructured};
20088 let mut buf = [0u8; 1024];
20089 rng.fill_bytes(&mut buf);
20090 let mut unstructured = Unstructured::new(&buf);
20091 Self::arbitrary(&mut unstructured).unwrap_or_default()
20092 }
20093}
20094impl Default for MISSION_SET_CURRENT_DATA {
20095 fn default() -> Self {
20096 Self::DEFAULT.clone()
20097 }
20098}
20099impl MessageData for MISSION_SET_CURRENT_DATA {
20100 type Message = MavMessage;
20101 const ID: u32 = 41u32;
20102 const NAME: &'static str = "MISSION_SET_CURRENT";
20103 const EXTRA_CRC: u8 = 28u8;
20104 const ENCODED_LEN: usize = 4usize;
20105 fn deser(
20106 _version: MavlinkVersion,
20107 __input: &[u8],
20108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20109 let avail_len = __input.len();
20110 let mut payload_buf = [0; Self::ENCODED_LEN];
20111 let mut buf = if avail_len < Self::ENCODED_LEN {
20112 payload_buf[0..avail_len].copy_from_slice(__input);
20113 Bytes::new(&payload_buf)
20114 } else {
20115 Bytes::new(__input)
20116 };
20117 let mut __struct = Self::default();
20118 __struct.seq = buf.get_u16_le();
20119 __struct.target_system = buf.get_u8();
20120 __struct.target_component = buf.get_u8();
20121 Ok(__struct)
20122 }
20123 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20124 let mut __tmp = BytesMut::new(bytes);
20125 #[allow(clippy::absurd_extreme_comparisons)]
20126 #[allow(unused_comparisons)]
20127 if __tmp.remaining() < Self::ENCODED_LEN {
20128 panic!(
20129 "buffer is too small (need {} bytes, but got {})",
20130 Self::ENCODED_LEN,
20131 __tmp.remaining(),
20132 )
20133 }
20134 __tmp.put_u16_le(self.seq);
20135 __tmp.put_u8(self.target_system);
20136 __tmp.put_u8(self.target_component);
20137 if matches!(version, MavlinkVersion::V2) {
20138 let len = __tmp.len();
20139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20140 } else {
20141 __tmp.len()
20142 }
20143 }
20144}
20145#[doc = "id: 38"]
20146#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20147#[derive(Debug, Clone, PartialEq)]
20148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20150pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20151 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20152 pub start_index: i16,
20153 #[doc = "End index, equal or greater than start index."]
20154 pub end_index: i16,
20155 #[doc = "System ID"]
20156 pub target_system: u8,
20157 #[doc = "Component ID"]
20158 pub target_component: u8,
20159 #[doc = "Mission type."]
20160 #[cfg_attr(feature = "serde", serde(default))]
20161 pub mission_type: MavMissionType,
20162}
20163impl MISSION_WRITE_PARTIAL_LIST_DATA {
20164 pub const ENCODED_LEN: usize = 7usize;
20165 pub const DEFAULT: Self = Self {
20166 start_index: 0_i16,
20167 end_index: 0_i16,
20168 target_system: 0_u8,
20169 target_component: 0_u8,
20170 mission_type: MavMissionType::DEFAULT,
20171 };
20172 #[cfg(feature = "arbitrary")]
20173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20174 use arbitrary::{Arbitrary, Unstructured};
20175 let mut buf = [0u8; 1024];
20176 rng.fill_bytes(&mut buf);
20177 let mut unstructured = Unstructured::new(&buf);
20178 Self::arbitrary(&mut unstructured).unwrap_or_default()
20179 }
20180}
20181impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20182 fn default() -> Self {
20183 Self::DEFAULT.clone()
20184 }
20185}
20186impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20187 type Message = MavMessage;
20188 const ID: u32 = 38u32;
20189 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20190 const EXTRA_CRC: u8 = 9u8;
20191 const ENCODED_LEN: usize = 7usize;
20192 fn deser(
20193 _version: MavlinkVersion,
20194 __input: &[u8],
20195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20196 let avail_len = __input.len();
20197 let mut payload_buf = [0; Self::ENCODED_LEN];
20198 let mut buf = if avail_len < Self::ENCODED_LEN {
20199 payload_buf[0..avail_len].copy_from_slice(__input);
20200 Bytes::new(&payload_buf)
20201 } else {
20202 Bytes::new(__input)
20203 };
20204 let mut __struct = Self::default();
20205 __struct.start_index = buf.get_i16_le();
20206 __struct.end_index = buf.get_i16_le();
20207 __struct.target_system = buf.get_u8();
20208 __struct.target_component = buf.get_u8();
20209 let tmp = buf.get_u8();
20210 __struct.mission_type =
20211 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20212 enum_type: "MavMissionType",
20213 value: tmp as u32,
20214 })?;
20215 Ok(__struct)
20216 }
20217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20218 let mut __tmp = BytesMut::new(bytes);
20219 #[allow(clippy::absurd_extreme_comparisons)]
20220 #[allow(unused_comparisons)]
20221 if __tmp.remaining() < Self::ENCODED_LEN {
20222 panic!(
20223 "buffer is too small (need {} bytes, but got {})",
20224 Self::ENCODED_LEN,
20225 __tmp.remaining(),
20226 )
20227 }
20228 __tmp.put_i16_le(self.start_index);
20229 __tmp.put_i16_le(self.end_index);
20230 __tmp.put_u8(self.target_system);
20231 __tmp.put_u8(self.target_component);
20232 __tmp.put_u8(self.mission_type as u8);
20233 if matches!(version, MavlinkVersion::V2) {
20234 let len = __tmp.len();
20235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20236 } else {
20237 __tmp.len()
20238 }
20239 }
20240}
20241#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20242#[doc = "id: 265"]
20243#[doc = "Orientation of a mount."]
20244#[derive(Debug, Clone, PartialEq)]
20245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20247pub struct MOUNT_ORIENTATION_DATA {
20248 #[doc = "Timestamp (time since system boot)."]
20249 pub time_boot_ms: u32,
20250 #[doc = "Roll in global frame (set to NaN for invalid)."]
20251 pub roll: f32,
20252 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20253 pub pitch: f32,
20254 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20255 pub yaw: f32,
20256 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20257 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20258 pub yaw_absolute: f32,
20259}
20260impl MOUNT_ORIENTATION_DATA {
20261 pub const ENCODED_LEN: usize = 20usize;
20262 pub const DEFAULT: Self = Self {
20263 time_boot_ms: 0_u32,
20264 roll: 0.0_f32,
20265 pitch: 0.0_f32,
20266 yaw: 0.0_f32,
20267 yaw_absolute: 0.0_f32,
20268 };
20269 #[cfg(feature = "arbitrary")]
20270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20271 use arbitrary::{Arbitrary, Unstructured};
20272 let mut buf = [0u8; 1024];
20273 rng.fill_bytes(&mut buf);
20274 let mut unstructured = Unstructured::new(&buf);
20275 Self::arbitrary(&mut unstructured).unwrap_or_default()
20276 }
20277}
20278impl Default for MOUNT_ORIENTATION_DATA {
20279 fn default() -> Self {
20280 Self::DEFAULT.clone()
20281 }
20282}
20283impl MessageData for MOUNT_ORIENTATION_DATA {
20284 type Message = MavMessage;
20285 const ID: u32 = 265u32;
20286 const NAME: &'static str = "MOUNT_ORIENTATION";
20287 const EXTRA_CRC: u8 = 26u8;
20288 const ENCODED_LEN: usize = 20usize;
20289 fn deser(
20290 _version: MavlinkVersion,
20291 __input: &[u8],
20292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20293 let avail_len = __input.len();
20294 let mut payload_buf = [0; Self::ENCODED_LEN];
20295 let mut buf = if avail_len < Self::ENCODED_LEN {
20296 payload_buf[0..avail_len].copy_from_slice(__input);
20297 Bytes::new(&payload_buf)
20298 } else {
20299 Bytes::new(__input)
20300 };
20301 let mut __struct = Self::default();
20302 __struct.time_boot_ms = buf.get_u32_le();
20303 __struct.roll = buf.get_f32_le();
20304 __struct.pitch = buf.get_f32_le();
20305 __struct.yaw = buf.get_f32_le();
20306 __struct.yaw_absolute = buf.get_f32_le();
20307 Ok(__struct)
20308 }
20309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20310 let mut __tmp = BytesMut::new(bytes);
20311 #[allow(clippy::absurd_extreme_comparisons)]
20312 #[allow(unused_comparisons)]
20313 if __tmp.remaining() < Self::ENCODED_LEN {
20314 panic!(
20315 "buffer is too small (need {} bytes, but got {})",
20316 Self::ENCODED_LEN,
20317 __tmp.remaining(),
20318 )
20319 }
20320 __tmp.put_u32_le(self.time_boot_ms);
20321 __tmp.put_f32_le(self.roll);
20322 __tmp.put_f32_le(self.pitch);
20323 __tmp.put_f32_le(self.yaw);
20324 __tmp.put_f32_le(self.yaw_absolute);
20325 if matches!(version, MavlinkVersion::V2) {
20326 let len = __tmp.len();
20327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20328 } else {
20329 __tmp.len()
20330 }
20331 }
20332}
20333#[doc = "id: 251"]
20334#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20335#[derive(Debug, Clone, PartialEq)]
20336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20338pub struct NAMED_VALUE_FLOAT_DATA {
20339 #[doc = "Timestamp (time since system boot)."]
20340 pub time_boot_ms: u32,
20341 #[doc = "Floating point value"]
20342 pub value: f32,
20343 #[doc = "Name of the debug variable"]
20344 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20345 pub name: [u8; 10],
20346}
20347impl NAMED_VALUE_FLOAT_DATA {
20348 pub const ENCODED_LEN: usize = 18usize;
20349 pub const DEFAULT: Self = Self {
20350 time_boot_ms: 0_u32,
20351 value: 0.0_f32,
20352 name: [0_u8; 10usize],
20353 };
20354 #[cfg(feature = "arbitrary")]
20355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20356 use arbitrary::{Arbitrary, Unstructured};
20357 let mut buf = [0u8; 1024];
20358 rng.fill_bytes(&mut buf);
20359 let mut unstructured = Unstructured::new(&buf);
20360 Self::arbitrary(&mut unstructured).unwrap_or_default()
20361 }
20362}
20363impl Default for NAMED_VALUE_FLOAT_DATA {
20364 fn default() -> Self {
20365 Self::DEFAULT.clone()
20366 }
20367}
20368impl MessageData for NAMED_VALUE_FLOAT_DATA {
20369 type Message = MavMessage;
20370 const ID: u32 = 251u32;
20371 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20372 const EXTRA_CRC: u8 = 170u8;
20373 const ENCODED_LEN: usize = 18usize;
20374 fn deser(
20375 _version: MavlinkVersion,
20376 __input: &[u8],
20377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20378 let avail_len = __input.len();
20379 let mut payload_buf = [0; Self::ENCODED_LEN];
20380 let mut buf = if avail_len < Self::ENCODED_LEN {
20381 payload_buf[0..avail_len].copy_from_slice(__input);
20382 Bytes::new(&payload_buf)
20383 } else {
20384 Bytes::new(__input)
20385 };
20386 let mut __struct = Self::default();
20387 __struct.time_boot_ms = buf.get_u32_le();
20388 __struct.value = buf.get_f32_le();
20389 for v in &mut __struct.name {
20390 let val = buf.get_u8();
20391 *v = val;
20392 }
20393 Ok(__struct)
20394 }
20395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20396 let mut __tmp = BytesMut::new(bytes);
20397 #[allow(clippy::absurd_extreme_comparisons)]
20398 #[allow(unused_comparisons)]
20399 if __tmp.remaining() < Self::ENCODED_LEN {
20400 panic!(
20401 "buffer is too small (need {} bytes, but got {})",
20402 Self::ENCODED_LEN,
20403 __tmp.remaining(),
20404 )
20405 }
20406 __tmp.put_u32_le(self.time_boot_ms);
20407 __tmp.put_f32_le(self.value);
20408 for val in &self.name {
20409 __tmp.put_u8(*val);
20410 }
20411 if matches!(version, MavlinkVersion::V2) {
20412 let len = __tmp.len();
20413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20414 } else {
20415 __tmp.len()
20416 }
20417 }
20418}
20419#[doc = "id: 252"]
20420#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20421#[derive(Debug, Clone, PartialEq)]
20422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20424pub struct NAMED_VALUE_INT_DATA {
20425 #[doc = "Timestamp (time since system boot)."]
20426 pub time_boot_ms: u32,
20427 #[doc = "Signed integer value"]
20428 pub value: i32,
20429 #[doc = "Name of the debug variable"]
20430 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20431 pub name: [u8; 10],
20432}
20433impl NAMED_VALUE_INT_DATA {
20434 pub const ENCODED_LEN: usize = 18usize;
20435 pub const DEFAULT: Self = Self {
20436 time_boot_ms: 0_u32,
20437 value: 0_i32,
20438 name: [0_u8; 10usize],
20439 };
20440 #[cfg(feature = "arbitrary")]
20441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20442 use arbitrary::{Arbitrary, Unstructured};
20443 let mut buf = [0u8; 1024];
20444 rng.fill_bytes(&mut buf);
20445 let mut unstructured = Unstructured::new(&buf);
20446 Self::arbitrary(&mut unstructured).unwrap_or_default()
20447 }
20448}
20449impl Default for NAMED_VALUE_INT_DATA {
20450 fn default() -> Self {
20451 Self::DEFAULT.clone()
20452 }
20453}
20454impl MessageData for NAMED_VALUE_INT_DATA {
20455 type Message = MavMessage;
20456 const ID: u32 = 252u32;
20457 const NAME: &'static str = "NAMED_VALUE_INT";
20458 const EXTRA_CRC: u8 = 44u8;
20459 const ENCODED_LEN: usize = 18usize;
20460 fn deser(
20461 _version: MavlinkVersion,
20462 __input: &[u8],
20463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20464 let avail_len = __input.len();
20465 let mut payload_buf = [0; Self::ENCODED_LEN];
20466 let mut buf = if avail_len < Self::ENCODED_LEN {
20467 payload_buf[0..avail_len].copy_from_slice(__input);
20468 Bytes::new(&payload_buf)
20469 } else {
20470 Bytes::new(__input)
20471 };
20472 let mut __struct = Self::default();
20473 __struct.time_boot_ms = buf.get_u32_le();
20474 __struct.value = buf.get_i32_le();
20475 for v in &mut __struct.name {
20476 let val = buf.get_u8();
20477 *v = val;
20478 }
20479 Ok(__struct)
20480 }
20481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20482 let mut __tmp = BytesMut::new(bytes);
20483 #[allow(clippy::absurd_extreme_comparisons)]
20484 #[allow(unused_comparisons)]
20485 if __tmp.remaining() < Self::ENCODED_LEN {
20486 panic!(
20487 "buffer is too small (need {} bytes, but got {})",
20488 Self::ENCODED_LEN,
20489 __tmp.remaining(),
20490 )
20491 }
20492 __tmp.put_u32_le(self.time_boot_ms);
20493 __tmp.put_i32_le(self.value);
20494 for val in &self.name {
20495 __tmp.put_u8(*val);
20496 }
20497 if matches!(version, MavlinkVersion::V2) {
20498 let len = __tmp.len();
20499 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20500 } else {
20501 __tmp.len()
20502 }
20503 }
20504}
20505#[doc = "id: 62"]
20506#[doc = "The state of the navigation and position controller."]
20507#[derive(Debug, Clone, PartialEq)]
20508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20510pub struct NAV_CONTROLLER_OUTPUT_DATA {
20511 #[doc = "Current desired roll"]
20512 pub nav_roll: f32,
20513 #[doc = "Current desired pitch"]
20514 pub nav_pitch: f32,
20515 #[doc = "Current altitude error"]
20516 pub alt_error: f32,
20517 #[doc = "Current airspeed error"]
20518 pub aspd_error: f32,
20519 #[doc = "Current crosstrack error on x-y plane"]
20520 pub xtrack_error: f32,
20521 #[doc = "Current desired heading"]
20522 pub nav_bearing: i16,
20523 #[doc = "Bearing to current waypoint/target"]
20524 pub target_bearing: i16,
20525 #[doc = "Distance to active waypoint"]
20526 pub wp_dist: u16,
20527}
20528impl NAV_CONTROLLER_OUTPUT_DATA {
20529 pub const ENCODED_LEN: usize = 26usize;
20530 pub const DEFAULT: Self = Self {
20531 nav_roll: 0.0_f32,
20532 nav_pitch: 0.0_f32,
20533 alt_error: 0.0_f32,
20534 aspd_error: 0.0_f32,
20535 xtrack_error: 0.0_f32,
20536 nav_bearing: 0_i16,
20537 target_bearing: 0_i16,
20538 wp_dist: 0_u16,
20539 };
20540 #[cfg(feature = "arbitrary")]
20541 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20542 use arbitrary::{Arbitrary, Unstructured};
20543 let mut buf = [0u8; 1024];
20544 rng.fill_bytes(&mut buf);
20545 let mut unstructured = Unstructured::new(&buf);
20546 Self::arbitrary(&mut unstructured).unwrap_or_default()
20547 }
20548}
20549impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20550 fn default() -> Self {
20551 Self::DEFAULT.clone()
20552 }
20553}
20554impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20555 type Message = MavMessage;
20556 const ID: u32 = 62u32;
20557 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20558 const EXTRA_CRC: u8 = 183u8;
20559 const ENCODED_LEN: usize = 26usize;
20560 fn deser(
20561 _version: MavlinkVersion,
20562 __input: &[u8],
20563 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20564 let avail_len = __input.len();
20565 let mut payload_buf = [0; Self::ENCODED_LEN];
20566 let mut buf = if avail_len < Self::ENCODED_LEN {
20567 payload_buf[0..avail_len].copy_from_slice(__input);
20568 Bytes::new(&payload_buf)
20569 } else {
20570 Bytes::new(__input)
20571 };
20572 let mut __struct = Self::default();
20573 __struct.nav_roll = buf.get_f32_le();
20574 __struct.nav_pitch = buf.get_f32_le();
20575 __struct.alt_error = buf.get_f32_le();
20576 __struct.aspd_error = buf.get_f32_le();
20577 __struct.xtrack_error = buf.get_f32_le();
20578 __struct.nav_bearing = buf.get_i16_le();
20579 __struct.target_bearing = buf.get_i16_le();
20580 __struct.wp_dist = buf.get_u16_le();
20581 Ok(__struct)
20582 }
20583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20584 let mut __tmp = BytesMut::new(bytes);
20585 #[allow(clippy::absurd_extreme_comparisons)]
20586 #[allow(unused_comparisons)]
20587 if __tmp.remaining() < Self::ENCODED_LEN {
20588 panic!(
20589 "buffer is too small (need {} bytes, but got {})",
20590 Self::ENCODED_LEN,
20591 __tmp.remaining(),
20592 )
20593 }
20594 __tmp.put_f32_le(self.nav_roll);
20595 __tmp.put_f32_le(self.nav_pitch);
20596 __tmp.put_f32_le(self.alt_error);
20597 __tmp.put_f32_le(self.aspd_error);
20598 __tmp.put_f32_le(self.xtrack_error);
20599 __tmp.put_i16_le(self.nav_bearing);
20600 __tmp.put_i16_le(self.target_bearing);
20601 __tmp.put_u16_le(self.wp_dist);
20602 if matches!(version, MavlinkVersion::V2) {
20603 let len = __tmp.len();
20604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20605 } else {
20606 __tmp.len()
20607 }
20608 }
20609}
20610#[doc = "id: 330"]
20611#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20612#[derive(Debug, Clone, PartialEq)]
20613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20615pub struct OBSTACLE_DISTANCE_DATA {
20616 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20617 pub time_usec: u64,
20618 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20619 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20620 pub distances: [u16; 72],
20621 #[doc = "Minimum distance the sensor can measure."]
20622 pub min_distance: u16,
20623 #[doc = "Maximum distance the sensor can measure."]
20624 pub max_distance: u16,
20625 #[doc = "Class id of the distance sensor type."]
20626 pub sensor_type: MavDistanceSensor,
20627 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20628 pub increment: u8,
20629 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20630 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20631 pub increment_f: f32,
20632 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20634 pub angle_offset: f32,
20635 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20636 #[cfg_attr(feature = "serde", serde(default))]
20637 pub frame: MavFrame,
20638}
20639impl OBSTACLE_DISTANCE_DATA {
20640 pub const ENCODED_LEN: usize = 167usize;
20641 pub const DEFAULT: Self = Self {
20642 time_usec: 0_u64,
20643 distances: [0_u16; 72usize],
20644 min_distance: 0_u16,
20645 max_distance: 0_u16,
20646 sensor_type: MavDistanceSensor::DEFAULT,
20647 increment: 0_u8,
20648 increment_f: 0.0_f32,
20649 angle_offset: 0.0_f32,
20650 frame: MavFrame::DEFAULT,
20651 };
20652 #[cfg(feature = "arbitrary")]
20653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20654 use arbitrary::{Arbitrary, Unstructured};
20655 let mut buf = [0u8; 1024];
20656 rng.fill_bytes(&mut buf);
20657 let mut unstructured = Unstructured::new(&buf);
20658 Self::arbitrary(&mut unstructured).unwrap_or_default()
20659 }
20660}
20661impl Default for OBSTACLE_DISTANCE_DATA {
20662 fn default() -> Self {
20663 Self::DEFAULT.clone()
20664 }
20665}
20666impl MessageData for OBSTACLE_DISTANCE_DATA {
20667 type Message = MavMessage;
20668 const ID: u32 = 330u32;
20669 const NAME: &'static str = "OBSTACLE_DISTANCE";
20670 const EXTRA_CRC: u8 = 23u8;
20671 const ENCODED_LEN: usize = 167usize;
20672 fn deser(
20673 _version: MavlinkVersion,
20674 __input: &[u8],
20675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20676 let avail_len = __input.len();
20677 let mut payload_buf = [0; Self::ENCODED_LEN];
20678 let mut buf = if avail_len < Self::ENCODED_LEN {
20679 payload_buf[0..avail_len].copy_from_slice(__input);
20680 Bytes::new(&payload_buf)
20681 } else {
20682 Bytes::new(__input)
20683 };
20684 let mut __struct = Self::default();
20685 __struct.time_usec = buf.get_u64_le();
20686 for v in &mut __struct.distances {
20687 let val = buf.get_u16_le();
20688 *v = val;
20689 }
20690 __struct.min_distance = buf.get_u16_le();
20691 __struct.max_distance = buf.get_u16_le();
20692 let tmp = buf.get_u8();
20693 __struct.sensor_type =
20694 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20695 enum_type: "MavDistanceSensor",
20696 value: tmp as u32,
20697 })?;
20698 __struct.increment = buf.get_u8();
20699 __struct.increment_f = buf.get_f32_le();
20700 __struct.angle_offset = buf.get_f32_le();
20701 let tmp = buf.get_u8();
20702 __struct.frame =
20703 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20704 enum_type: "MavFrame",
20705 value: tmp as u32,
20706 })?;
20707 Ok(__struct)
20708 }
20709 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20710 let mut __tmp = BytesMut::new(bytes);
20711 #[allow(clippy::absurd_extreme_comparisons)]
20712 #[allow(unused_comparisons)]
20713 if __tmp.remaining() < Self::ENCODED_LEN {
20714 panic!(
20715 "buffer is too small (need {} bytes, but got {})",
20716 Self::ENCODED_LEN,
20717 __tmp.remaining(),
20718 )
20719 }
20720 __tmp.put_u64_le(self.time_usec);
20721 for val in &self.distances {
20722 __tmp.put_u16_le(*val);
20723 }
20724 __tmp.put_u16_le(self.min_distance);
20725 __tmp.put_u16_le(self.max_distance);
20726 __tmp.put_u8(self.sensor_type as u8);
20727 __tmp.put_u8(self.increment);
20728 __tmp.put_f32_le(self.increment_f);
20729 __tmp.put_f32_le(self.angle_offset);
20730 __tmp.put_u8(self.frame as u8);
20731 if matches!(version, MavlinkVersion::V2) {
20732 let len = __tmp.len();
20733 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20734 } else {
20735 __tmp.len()
20736 }
20737 }
20738}
20739#[doc = "id: 331"]
20740#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20741#[derive(Debug, Clone, PartialEq)]
20742#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20743#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20744pub struct ODOMETRY_DATA {
20745 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20746 pub time_usec: u64,
20747 #[doc = "X Position"]
20748 pub x: f32,
20749 #[doc = "Y Position"]
20750 pub y: f32,
20751 #[doc = "Z Position"]
20752 pub z: f32,
20753 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20755 pub q: [f32; 4],
20756 #[doc = "X linear speed"]
20757 pub vx: f32,
20758 #[doc = "Y linear speed"]
20759 pub vy: f32,
20760 #[doc = "Z linear speed"]
20761 pub vz: f32,
20762 #[doc = "Roll angular speed"]
20763 pub rollspeed: f32,
20764 #[doc = "Pitch angular speed"]
20765 pub pitchspeed: f32,
20766 #[doc = "Yaw angular speed"]
20767 pub yawspeed: f32,
20768 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20769 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20770 pub pose_covariance: [f32; 21],
20771 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20773 pub velocity_covariance: [f32; 21],
20774 #[doc = "Coordinate frame of reference for the pose data."]
20775 pub frame_id: MavFrame,
20776 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20777 pub child_frame_id: MavFrame,
20778 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20780 pub reset_counter: u8,
20781 #[doc = "Type of estimator that is providing the odometry."]
20782 #[cfg_attr(feature = "serde", serde(default))]
20783 pub estimator_type: MavEstimatorType,
20784 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20785 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20786 pub quality: i8,
20787}
20788impl ODOMETRY_DATA {
20789 pub const ENCODED_LEN: usize = 233usize;
20790 pub const DEFAULT: Self = Self {
20791 time_usec: 0_u64,
20792 x: 0.0_f32,
20793 y: 0.0_f32,
20794 z: 0.0_f32,
20795 q: [0.0_f32; 4usize],
20796 vx: 0.0_f32,
20797 vy: 0.0_f32,
20798 vz: 0.0_f32,
20799 rollspeed: 0.0_f32,
20800 pitchspeed: 0.0_f32,
20801 yawspeed: 0.0_f32,
20802 pose_covariance: [0.0_f32; 21usize],
20803 velocity_covariance: [0.0_f32; 21usize],
20804 frame_id: MavFrame::DEFAULT,
20805 child_frame_id: MavFrame::DEFAULT,
20806 reset_counter: 0_u8,
20807 estimator_type: MavEstimatorType::DEFAULT,
20808 quality: 0_i8,
20809 };
20810 #[cfg(feature = "arbitrary")]
20811 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20812 use arbitrary::{Arbitrary, Unstructured};
20813 let mut buf = [0u8; 1024];
20814 rng.fill_bytes(&mut buf);
20815 let mut unstructured = Unstructured::new(&buf);
20816 Self::arbitrary(&mut unstructured).unwrap_or_default()
20817 }
20818}
20819impl Default for ODOMETRY_DATA {
20820 fn default() -> Self {
20821 Self::DEFAULT.clone()
20822 }
20823}
20824impl MessageData for ODOMETRY_DATA {
20825 type Message = MavMessage;
20826 const ID: u32 = 331u32;
20827 const NAME: &'static str = "ODOMETRY";
20828 const EXTRA_CRC: u8 = 91u8;
20829 const ENCODED_LEN: usize = 233usize;
20830 fn deser(
20831 _version: MavlinkVersion,
20832 __input: &[u8],
20833 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20834 let avail_len = __input.len();
20835 let mut payload_buf = [0; Self::ENCODED_LEN];
20836 let mut buf = if avail_len < Self::ENCODED_LEN {
20837 payload_buf[0..avail_len].copy_from_slice(__input);
20838 Bytes::new(&payload_buf)
20839 } else {
20840 Bytes::new(__input)
20841 };
20842 let mut __struct = Self::default();
20843 __struct.time_usec = buf.get_u64_le();
20844 __struct.x = buf.get_f32_le();
20845 __struct.y = buf.get_f32_le();
20846 __struct.z = buf.get_f32_le();
20847 for v in &mut __struct.q {
20848 let val = buf.get_f32_le();
20849 *v = val;
20850 }
20851 __struct.vx = buf.get_f32_le();
20852 __struct.vy = buf.get_f32_le();
20853 __struct.vz = buf.get_f32_le();
20854 __struct.rollspeed = buf.get_f32_le();
20855 __struct.pitchspeed = buf.get_f32_le();
20856 __struct.yawspeed = buf.get_f32_le();
20857 for v in &mut __struct.pose_covariance {
20858 let val = buf.get_f32_le();
20859 *v = val;
20860 }
20861 for v in &mut __struct.velocity_covariance {
20862 let val = buf.get_f32_le();
20863 *v = val;
20864 }
20865 let tmp = buf.get_u8();
20866 __struct.frame_id =
20867 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20868 enum_type: "MavFrame",
20869 value: tmp as u32,
20870 })?;
20871 let tmp = buf.get_u8();
20872 __struct.child_frame_id =
20873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20874 enum_type: "MavFrame",
20875 value: tmp as u32,
20876 })?;
20877 __struct.reset_counter = buf.get_u8();
20878 let tmp = buf.get_u8();
20879 __struct.estimator_type =
20880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20881 enum_type: "MavEstimatorType",
20882 value: tmp as u32,
20883 })?;
20884 __struct.quality = buf.get_i8();
20885 Ok(__struct)
20886 }
20887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20888 let mut __tmp = BytesMut::new(bytes);
20889 #[allow(clippy::absurd_extreme_comparisons)]
20890 #[allow(unused_comparisons)]
20891 if __tmp.remaining() < Self::ENCODED_LEN {
20892 panic!(
20893 "buffer is too small (need {} bytes, but got {})",
20894 Self::ENCODED_LEN,
20895 __tmp.remaining(),
20896 )
20897 }
20898 __tmp.put_u64_le(self.time_usec);
20899 __tmp.put_f32_le(self.x);
20900 __tmp.put_f32_le(self.y);
20901 __tmp.put_f32_le(self.z);
20902 for val in &self.q {
20903 __tmp.put_f32_le(*val);
20904 }
20905 __tmp.put_f32_le(self.vx);
20906 __tmp.put_f32_le(self.vy);
20907 __tmp.put_f32_le(self.vz);
20908 __tmp.put_f32_le(self.rollspeed);
20909 __tmp.put_f32_le(self.pitchspeed);
20910 __tmp.put_f32_le(self.yawspeed);
20911 for val in &self.pose_covariance {
20912 __tmp.put_f32_le(*val);
20913 }
20914 for val in &self.velocity_covariance {
20915 __tmp.put_f32_le(*val);
20916 }
20917 __tmp.put_u8(self.frame_id as u8);
20918 __tmp.put_u8(self.child_frame_id as u8);
20919 __tmp.put_u8(self.reset_counter);
20920 __tmp.put_u8(self.estimator_type as u8);
20921 __tmp.put_i8(self.quality);
20922 if matches!(version, MavlinkVersion::V2) {
20923 let len = __tmp.len();
20924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20925 } else {
20926 __tmp.len()
20927 }
20928 }
20929}
20930#[doc = "id: 390"]
20931#[doc = "Hardware status sent by an onboard computer."]
20932#[derive(Debug, Clone, PartialEq)]
20933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20935pub struct ONBOARD_COMPUTER_STATUS_DATA {
20936 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20937 pub time_usec: u64,
20938 #[doc = "Time since system boot."]
20939 pub uptime: u32,
20940 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20941 pub ram_usage: u32,
20942 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20943 pub ram_total: u32,
20944 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20946 pub storage_type: [u32; 4],
20947 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20948 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20949 pub storage_usage: [u32; 4],
20950 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20952 pub storage_total: [u32; 4],
20953 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20955 pub link_type: [u32; 6],
20956 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20957 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20958 pub link_tx_rate: [u32; 6],
20959 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20961 pub link_rx_rate: [u32; 6],
20962 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20964 pub link_tx_max: [u32; 6],
20965 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20966 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20967 pub link_rx_max: [u32; 6],
20968 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20969 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20970 pub fan_speed: [i16; 4],
20971 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20972 pub mavtype: u8,
20973 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20975 pub cpu_cores: [u8; 8],
20976 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20978 pub cpu_combined: [u8; 10],
20979 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20981 pub gpu_cores: [u8; 4],
20982 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20983 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20984 pub gpu_combined: [u8; 10],
20985 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20986 pub temperature_board: i8,
20987 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20988 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20989 pub temperature_core: [i8; 8],
20990}
20991impl ONBOARD_COMPUTER_STATUS_DATA {
20992 pub const ENCODED_LEN: usize = 238usize;
20993 pub const DEFAULT: Self = Self {
20994 time_usec: 0_u64,
20995 uptime: 0_u32,
20996 ram_usage: 0_u32,
20997 ram_total: 0_u32,
20998 storage_type: [0_u32; 4usize],
20999 storage_usage: [0_u32; 4usize],
21000 storage_total: [0_u32; 4usize],
21001 link_type: [0_u32; 6usize],
21002 link_tx_rate: [0_u32; 6usize],
21003 link_rx_rate: [0_u32; 6usize],
21004 link_tx_max: [0_u32; 6usize],
21005 link_rx_max: [0_u32; 6usize],
21006 fan_speed: [0_i16; 4usize],
21007 mavtype: 0_u8,
21008 cpu_cores: [0_u8; 8usize],
21009 cpu_combined: [0_u8; 10usize],
21010 gpu_cores: [0_u8; 4usize],
21011 gpu_combined: [0_u8; 10usize],
21012 temperature_board: 0_i8,
21013 temperature_core: [0_i8; 8usize],
21014 };
21015 #[cfg(feature = "arbitrary")]
21016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21017 use arbitrary::{Arbitrary, Unstructured};
21018 let mut buf = [0u8; 1024];
21019 rng.fill_bytes(&mut buf);
21020 let mut unstructured = Unstructured::new(&buf);
21021 Self::arbitrary(&mut unstructured).unwrap_or_default()
21022 }
21023}
21024impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21025 fn default() -> Self {
21026 Self::DEFAULT.clone()
21027 }
21028}
21029impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21030 type Message = MavMessage;
21031 const ID: u32 = 390u32;
21032 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21033 const EXTRA_CRC: u8 = 156u8;
21034 const ENCODED_LEN: usize = 238usize;
21035 fn deser(
21036 _version: MavlinkVersion,
21037 __input: &[u8],
21038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21039 let avail_len = __input.len();
21040 let mut payload_buf = [0; Self::ENCODED_LEN];
21041 let mut buf = if avail_len < Self::ENCODED_LEN {
21042 payload_buf[0..avail_len].copy_from_slice(__input);
21043 Bytes::new(&payload_buf)
21044 } else {
21045 Bytes::new(__input)
21046 };
21047 let mut __struct = Self::default();
21048 __struct.time_usec = buf.get_u64_le();
21049 __struct.uptime = buf.get_u32_le();
21050 __struct.ram_usage = buf.get_u32_le();
21051 __struct.ram_total = buf.get_u32_le();
21052 for v in &mut __struct.storage_type {
21053 let val = buf.get_u32_le();
21054 *v = val;
21055 }
21056 for v in &mut __struct.storage_usage {
21057 let val = buf.get_u32_le();
21058 *v = val;
21059 }
21060 for v in &mut __struct.storage_total {
21061 let val = buf.get_u32_le();
21062 *v = val;
21063 }
21064 for v in &mut __struct.link_type {
21065 let val = buf.get_u32_le();
21066 *v = val;
21067 }
21068 for v in &mut __struct.link_tx_rate {
21069 let val = buf.get_u32_le();
21070 *v = val;
21071 }
21072 for v in &mut __struct.link_rx_rate {
21073 let val = buf.get_u32_le();
21074 *v = val;
21075 }
21076 for v in &mut __struct.link_tx_max {
21077 let val = buf.get_u32_le();
21078 *v = val;
21079 }
21080 for v in &mut __struct.link_rx_max {
21081 let val = buf.get_u32_le();
21082 *v = val;
21083 }
21084 for v in &mut __struct.fan_speed {
21085 let val = buf.get_i16_le();
21086 *v = val;
21087 }
21088 __struct.mavtype = buf.get_u8();
21089 for v in &mut __struct.cpu_cores {
21090 let val = buf.get_u8();
21091 *v = val;
21092 }
21093 for v in &mut __struct.cpu_combined {
21094 let val = buf.get_u8();
21095 *v = val;
21096 }
21097 for v in &mut __struct.gpu_cores {
21098 let val = buf.get_u8();
21099 *v = val;
21100 }
21101 for v in &mut __struct.gpu_combined {
21102 let val = buf.get_u8();
21103 *v = val;
21104 }
21105 __struct.temperature_board = buf.get_i8();
21106 for v in &mut __struct.temperature_core {
21107 let val = buf.get_i8();
21108 *v = val;
21109 }
21110 Ok(__struct)
21111 }
21112 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21113 let mut __tmp = BytesMut::new(bytes);
21114 #[allow(clippy::absurd_extreme_comparisons)]
21115 #[allow(unused_comparisons)]
21116 if __tmp.remaining() < Self::ENCODED_LEN {
21117 panic!(
21118 "buffer is too small (need {} bytes, but got {})",
21119 Self::ENCODED_LEN,
21120 __tmp.remaining(),
21121 )
21122 }
21123 __tmp.put_u64_le(self.time_usec);
21124 __tmp.put_u32_le(self.uptime);
21125 __tmp.put_u32_le(self.ram_usage);
21126 __tmp.put_u32_le(self.ram_total);
21127 for val in &self.storage_type {
21128 __tmp.put_u32_le(*val);
21129 }
21130 for val in &self.storage_usage {
21131 __tmp.put_u32_le(*val);
21132 }
21133 for val in &self.storage_total {
21134 __tmp.put_u32_le(*val);
21135 }
21136 for val in &self.link_type {
21137 __tmp.put_u32_le(*val);
21138 }
21139 for val in &self.link_tx_rate {
21140 __tmp.put_u32_le(*val);
21141 }
21142 for val in &self.link_rx_rate {
21143 __tmp.put_u32_le(*val);
21144 }
21145 for val in &self.link_tx_max {
21146 __tmp.put_u32_le(*val);
21147 }
21148 for val in &self.link_rx_max {
21149 __tmp.put_u32_le(*val);
21150 }
21151 for val in &self.fan_speed {
21152 __tmp.put_i16_le(*val);
21153 }
21154 __tmp.put_u8(self.mavtype);
21155 for val in &self.cpu_cores {
21156 __tmp.put_u8(*val);
21157 }
21158 for val in &self.cpu_combined {
21159 __tmp.put_u8(*val);
21160 }
21161 for val in &self.gpu_cores {
21162 __tmp.put_u8(*val);
21163 }
21164 for val in &self.gpu_combined {
21165 __tmp.put_u8(*val);
21166 }
21167 __tmp.put_i8(self.temperature_board);
21168 for val in &self.temperature_core {
21169 __tmp.put_i8(*val);
21170 }
21171 if matches!(version, MavlinkVersion::V2) {
21172 let len = __tmp.len();
21173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21174 } else {
21175 __tmp.len()
21176 }
21177 }
21178}
21179#[doc = "id: 12918"]
21180#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21181#[derive(Debug, Clone, PartialEq)]
21182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21184pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21185 #[doc = "Status level indicating if arming is allowed."]
21186 pub status: MavOdidArmStatus,
21187 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21189 pub error: [u8; 50],
21190}
21191impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21192 pub const ENCODED_LEN: usize = 51usize;
21193 pub const DEFAULT: Self = Self {
21194 status: MavOdidArmStatus::DEFAULT,
21195 error: [0_u8; 50usize],
21196 };
21197 #[cfg(feature = "arbitrary")]
21198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21199 use arbitrary::{Arbitrary, Unstructured};
21200 let mut buf = [0u8; 1024];
21201 rng.fill_bytes(&mut buf);
21202 let mut unstructured = Unstructured::new(&buf);
21203 Self::arbitrary(&mut unstructured).unwrap_or_default()
21204 }
21205}
21206impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21207 fn default() -> Self {
21208 Self::DEFAULT.clone()
21209 }
21210}
21211impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21212 type Message = MavMessage;
21213 const ID: u32 = 12918u32;
21214 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21215 const EXTRA_CRC: u8 = 139u8;
21216 const ENCODED_LEN: usize = 51usize;
21217 fn deser(
21218 _version: MavlinkVersion,
21219 __input: &[u8],
21220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21221 let avail_len = __input.len();
21222 let mut payload_buf = [0; Self::ENCODED_LEN];
21223 let mut buf = if avail_len < Self::ENCODED_LEN {
21224 payload_buf[0..avail_len].copy_from_slice(__input);
21225 Bytes::new(&payload_buf)
21226 } else {
21227 Bytes::new(__input)
21228 };
21229 let mut __struct = Self::default();
21230 let tmp = buf.get_u8();
21231 __struct.status =
21232 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21233 enum_type: "MavOdidArmStatus",
21234 value: tmp as u32,
21235 })?;
21236 for v in &mut __struct.error {
21237 let val = buf.get_u8();
21238 *v = val;
21239 }
21240 Ok(__struct)
21241 }
21242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21243 let mut __tmp = BytesMut::new(bytes);
21244 #[allow(clippy::absurd_extreme_comparisons)]
21245 #[allow(unused_comparisons)]
21246 if __tmp.remaining() < Self::ENCODED_LEN {
21247 panic!(
21248 "buffer is too small (need {} bytes, but got {})",
21249 Self::ENCODED_LEN,
21250 __tmp.remaining(),
21251 )
21252 }
21253 __tmp.put_u8(self.status as u8);
21254 for val in &self.error {
21255 __tmp.put_u8(*val);
21256 }
21257 if matches!(version, MavlinkVersion::V2) {
21258 let len = __tmp.len();
21259 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21260 } else {
21261 __tmp.len()
21262 }
21263 }
21264}
21265#[doc = "id: 12902"]
21266#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21267#[derive(Debug, Clone, PartialEq)]
21268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21270pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21271 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21272 pub timestamp: u32,
21273 #[doc = "System ID (0 for broadcast)."]
21274 pub target_system: u8,
21275 #[doc = "Component ID (0 for broadcast)."]
21276 pub target_component: u8,
21277 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21278 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21279 pub id_or_mac: [u8; 20],
21280 #[doc = "Indicates the type of authentication."]
21281 pub authentication_type: MavOdidAuthType,
21282 #[doc = "Allowed range is 0 - 15."]
21283 pub data_page: u8,
21284 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21285 pub last_page_index: u8,
21286 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21287 pub length: u8,
21288 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21289 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21290 pub authentication_data: [u8; 23],
21291}
21292impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21293 pub const ENCODED_LEN: usize = 53usize;
21294 pub const DEFAULT: Self = Self {
21295 timestamp: 0_u32,
21296 target_system: 0_u8,
21297 target_component: 0_u8,
21298 id_or_mac: [0_u8; 20usize],
21299 authentication_type: MavOdidAuthType::DEFAULT,
21300 data_page: 0_u8,
21301 last_page_index: 0_u8,
21302 length: 0_u8,
21303 authentication_data: [0_u8; 23usize],
21304 };
21305 #[cfg(feature = "arbitrary")]
21306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21307 use arbitrary::{Arbitrary, Unstructured};
21308 let mut buf = [0u8; 1024];
21309 rng.fill_bytes(&mut buf);
21310 let mut unstructured = Unstructured::new(&buf);
21311 Self::arbitrary(&mut unstructured).unwrap_or_default()
21312 }
21313}
21314impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21315 fn default() -> Self {
21316 Self::DEFAULT.clone()
21317 }
21318}
21319impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21320 type Message = MavMessage;
21321 const ID: u32 = 12902u32;
21322 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21323 const EXTRA_CRC: u8 = 140u8;
21324 const ENCODED_LEN: usize = 53usize;
21325 fn deser(
21326 _version: MavlinkVersion,
21327 __input: &[u8],
21328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21329 let avail_len = __input.len();
21330 let mut payload_buf = [0; Self::ENCODED_LEN];
21331 let mut buf = if avail_len < Self::ENCODED_LEN {
21332 payload_buf[0..avail_len].copy_from_slice(__input);
21333 Bytes::new(&payload_buf)
21334 } else {
21335 Bytes::new(__input)
21336 };
21337 let mut __struct = Self::default();
21338 __struct.timestamp = buf.get_u32_le();
21339 __struct.target_system = buf.get_u8();
21340 __struct.target_component = buf.get_u8();
21341 for v in &mut __struct.id_or_mac {
21342 let val = buf.get_u8();
21343 *v = val;
21344 }
21345 let tmp = buf.get_u8();
21346 __struct.authentication_type =
21347 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21348 enum_type: "MavOdidAuthType",
21349 value: tmp as u32,
21350 })?;
21351 __struct.data_page = buf.get_u8();
21352 __struct.last_page_index = buf.get_u8();
21353 __struct.length = buf.get_u8();
21354 for v in &mut __struct.authentication_data {
21355 let val = buf.get_u8();
21356 *v = val;
21357 }
21358 Ok(__struct)
21359 }
21360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21361 let mut __tmp = BytesMut::new(bytes);
21362 #[allow(clippy::absurd_extreme_comparisons)]
21363 #[allow(unused_comparisons)]
21364 if __tmp.remaining() < Self::ENCODED_LEN {
21365 panic!(
21366 "buffer is too small (need {} bytes, but got {})",
21367 Self::ENCODED_LEN,
21368 __tmp.remaining(),
21369 )
21370 }
21371 __tmp.put_u32_le(self.timestamp);
21372 __tmp.put_u8(self.target_system);
21373 __tmp.put_u8(self.target_component);
21374 for val in &self.id_or_mac {
21375 __tmp.put_u8(*val);
21376 }
21377 __tmp.put_u8(self.authentication_type as u8);
21378 __tmp.put_u8(self.data_page);
21379 __tmp.put_u8(self.last_page_index);
21380 __tmp.put_u8(self.length);
21381 for val in &self.authentication_data {
21382 __tmp.put_u8(*val);
21383 }
21384 if matches!(version, MavlinkVersion::V2) {
21385 let len = __tmp.len();
21386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21387 } else {
21388 __tmp.len()
21389 }
21390 }
21391}
21392#[doc = "id: 12900"]
21393#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21394#[derive(Debug, Clone, PartialEq)]
21395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21397pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21398 #[doc = "System ID (0 for broadcast)."]
21399 pub target_system: u8,
21400 #[doc = "Component ID (0 for broadcast)."]
21401 pub target_component: u8,
21402 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21404 pub id_or_mac: [u8; 20],
21405 #[doc = "Indicates the format for the uas_id field of this message."]
21406 pub id_type: MavOdidIdType,
21407 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21408 pub ua_type: MavOdidUaType,
21409 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21410 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21411 pub uas_id: [u8; 20],
21412}
21413impl OPEN_DRONE_ID_BASIC_ID_DATA {
21414 pub const ENCODED_LEN: usize = 44usize;
21415 pub const DEFAULT: Self = Self {
21416 target_system: 0_u8,
21417 target_component: 0_u8,
21418 id_or_mac: [0_u8; 20usize],
21419 id_type: MavOdidIdType::DEFAULT,
21420 ua_type: MavOdidUaType::DEFAULT,
21421 uas_id: [0_u8; 20usize],
21422 };
21423 #[cfg(feature = "arbitrary")]
21424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21425 use arbitrary::{Arbitrary, Unstructured};
21426 let mut buf = [0u8; 1024];
21427 rng.fill_bytes(&mut buf);
21428 let mut unstructured = Unstructured::new(&buf);
21429 Self::arbitrary(&mut unstructured).unwrap_or_default()
21430 }
21431}
21432impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21433 fn default() -> Self {
21434 Self::DEFAULT.clone()
21435 }
21436}
21437impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21438 type Message = MavMessage;
21439 const ID: u32 = 12900u32;
21440 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21441 const EXTRA_CRC: u8 = 114u8;
21442 const ENCODED_LEN: usize = 44usize;
21443 fn deser(
21444 _version: MavlinkVersion,
21445 __input: &[u8],
21446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21447 let avail_len = __input.len();
21448 let mut payload_buf = [0; Self::ENCODED_LEN];
21449 let mut buf = if avail_len < Self::ENCODED_LEN {
21450 payload_buf[0..avail_len].copy_from_slice(__input);
21451 Bytes::new(&payload_buf)
21452 } else {
21453 Bytes::new(__input)
21454 };
21455 let mut __struct = Self::default();
21456 __struct.target_system = buf.get_u8();
21457 __struct.target_component = buf.get_u8();
21458 for v in &mut __struct.id_or_mac {
21459 let val = buf.get_u8();
21460 *v = val;
21461 }
21462 let tmp = buf.get_u8();
21463 __struct.id_type =
21464 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21465 enum_type: "MavOdidIdType",
21466 value: tmp as u32,
21467 })?;
21468 let tmp = buf.get_u8();
21469 __struct.ua_type =
21470 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21471 enum_type: "MavOdidUaType",
21472 value: tmp as u32,
21473 })?;
21474 for v in &mut __struct.uas_id {
21475 let val = buf.get_u8();
21476 *v = val;
21477 }
21478 Ok(__struct)
21479 }
21480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21481 let mut __tmp = BytesMut::new(bytes);
21482 #[allow(clippy::absurd_extreme_comparisons)]
21483 #[allow(unused_comparisons)]
21484 if __tmp.remaining() < Self::ENCODED_LEN {
21485 panic!(
21486 "buffer is too small (need {} bytes, but got {})",
21487 Self::ENCODED_LEN,
21488 __tmp.remaining(),
21489 )
21490 }
21491 __tmp.put_u8(self.target_system);
21492 __tmp.put_u8(self.target_component);
21493 for val in &self.id_or_mac {
21494 __tmp.put_u8(*val);
21495 }
21496 __tmp.put_u8(self.id_type as u8);
21497 __tmp.put_u8(self.ua_type as u8);
21498 for val in &self.uas_id {
21499 __tmp.put_u8(*val);
21500 }
21501 if matches!(version, MavlinkVersion::V2) {
21502 let len = __tmp.len();
21503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21504 } else {
21505 __tmp.len()
21506 }
21507 }
21508}
21509#[doc = "id: 12901"]
21510#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21511#[derive(Debug, Clone, PartialEq)]
21512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21514pub struct OPEN_DRONE_ID_LOCATION_DATA {
21515 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21516 pub latitude: i32,
21517 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21518 pub longitude: i32,
21519 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21520 pub altitude_barometric: f32,
21521 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21522 pub altitude_geodetic: f32,
21523 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21524 pub height: f32,
21525 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21526 pub timestamp: f32,
21527 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21528 pub direction: u16,
21529 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21530 pub speed_horizontal: u16,
21531 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21532 pub speed_vertical: i16,
21533 #[doc = "System ID (0 for broadcast)."]
21534 pub target_system: u8,
21535 #[doc = "Component ID (0 for broadcast)."]
21536 pub target_component: u8,
21537 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21539 pub id_or_mac: [u8; 20],
21540 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21541 pub status: MavOdidStatus,
21542 #[doc = "Indicates the reference point for the height field."]
21543 pub height_reference: MavOdidHeightRef,
21544 #[doc = "The accuracy of the horizontal position."]
21545 pub horizontal_accuracy: MavOdidHorAcc,
21546 #[doc = "The accuracy of the vertical position."]
21547 pub vertical_accuracy: MavOdidVerAcc,
21548 #[doc = "The accuracy of the barometric altitude."]
21549 pub barometer_accuracy: MavOdidVerAcc,
21550 #[doc = "The accuracy of the horizontal and vertical speed."]
21551 pub speed_accuracy: MavOdidSpeedAcc,
21552 #[doc = "The accuracy of the timestamps."]
21553 pub timestamp_accuracy: MavOdidTimeAcc,
21554}
21555impl OPEN_DRONE_ID_LOCATION_DATA {
21556 pub const ENCODED_LEN: usize = 59usize;
21557 pub const DEFAULT: Self = Self {
21558 latitude: 0_i32,
21559 longitude: 0_i32,
21560 altitude_barometric: 0.0_f32,
21561 altitude_geodetic: 0.0_f32,
21562 height: 0.0_f32,
21563 timestamp: 0.0_f32,
21564 direction: 0_u16,
21565 speed_horizontal: 0_u16,
21566 speed_vertical: 0_i16,
21567 target_system: 0_u8,
21568 target_component: 0_u8,
21569 id_or_mac: [0_u8; 20usize],
21570 status: MavOdidStatus::DEFAULT,
21571 height_reference: MavOdidHeightRef::DEFAULT,
21572 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21573 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21574 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21575 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21576 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21577 };
21578 #[cfg(feature = "arbitrary")]
21579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21580 use arbitrary::{Arbitrary, Unstructured};
21581 let mut buf = [0u8; 1024];
21582 rng.fill_bytes(&mut buf);
21583 let mut unstructured = Unstructured::new(&buf);
21584 Self::arbitrary(&mut unstructured).unwrap_or_default()
21585 }
21586}
21587impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21588 fn default() -> Self {
21589 Self::DEFAULT.clone()
21590 }
21591}
21592impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21593 type Message = MavMessage;
21594 const ID: u32 = 12901u32;
21595 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21596 const EXTRA_CRC: u8 = 254u8;
21597 const ENCODED_LEN: usize = 59usize;
21598 fn deser(
21599 _version: MavlinkVersion,
21600 __input: &[u8],
21601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21602 let avail_len = __input.len();
21603 let mut payload_buf = [0; Self::ENCODED_LEN];
21604 let mut buf = if avail_len < Self::ENCODED_LEN {
21605 payload_buf[0..avail_len].copy_from_slice(__input);
21606 Bytes::new(&payload_buf)
21607 } else {
21608 Bytes::new(__input)
21609 };
21610 let mut __struct = Self::default();
21611 __struct.latitude = buf.get_i32_le();
21612 __struct.longitude = buf.get_i32_le();
21613 __struct.altitude_barometric = buf.get_f32_le();
21614 __struct.altitude_geodetic = buf.get_f32_le();
21615 __struct.height = buf.get_f32_le();
21616 __struct.timestamp = buf.get_f32_le();
21617 __struct.direction = buf.get_u16_le();
21618 __struct.speed_horizontal = buf.get_u16_le();
21619 __struct.speed_vertical = buf.get_i16_le();
21620 __struct.target_system = buf.get_u8();
21621 __struct.target_component = buf.get_u8();
21622 for v in &mut __struct.id_or_mac {
21623 let val = buf.get_u8();
21624 *v = val;
21625 }
21626 let tmp = buf.get_u8();
21627 __struct.status =
21628 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21629 enum_type: "MavOdidStatus",
21630 value: tmp as u32,
21631 })?;
21632 let tmp = buf.get_u8();
21633 __struct.height_reference =
21634 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21635 enum_type: "MavOdidHeightRef",
21636 value: tmp as u32,
21637 })?;
21638 let tmp = buf.get_u8();
21639 __struct.horizontal_accuracy =
21640 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21641 enum_type: "MavOdidHorAcc",
21642 value: tmp as u32,
21643 })?;
21644 let tmp = buf.get_u8();
21645 __struct.vertical_accuracy =
21646 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21647 enum_type: "MavOdidVerAcc",
21648 value: tmp as u32,
21649 })?;
21650 let tmp = buf.get_u8();
21651 __struct.barometer_accuracy =
21652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21653 enum_type: "MavOdidVerAcc",
21654 value: tmp as u32,
21655 })?;
21656 let tmp = buf.get_u8();
21657 __struct.speed_accuracy =
21658 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21659 enum_type: "MavOdidSpeedAcc",
21660 value: tmp as u32,
21661 })?;
21662 let tmp = buf.get_u8();
21663 __struct.timestamp_accuracy =
21664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21665 enum_type: "MavOdidTimeAcc",
21666 value: tmp as u32,
21667 })?;
21668 Ok(__struct)
21669 }
21670 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21671 let mut __tmp = BytesMut::new(bytes);
21672 #[allow(clippy::absurd_extreme_comparisons)]
21673 #[allow(unused_comparisons)]
21674 if __tmp.remaining() < Self::ENCODED_LEN {
21675 panic!(
21676 "buffer is too small (need {} bytes, but got {})",
21677 Self::ENCODED_LEN,
21678 __tmp.remaining(),
21679 )
21680 }
21681 __tmp.put_i32_le(self.latitude);
21682 __tmp.put_i32_le(self.longitude);
21683 __tmp.put_f32_le(self.altitude_barometric);
21684 __tmp.put_f32_le(self.altitude_geodetic);
21685 __tmp.put_f32_le(self.height);
21686 __tmp.put_f32_le(self.timestamp);
21687 __tmp.put_u16_le(self.direction);
21688 __tmp.put_u16_le(self.speed_horizontal);
21689 __tmp.put_i16_le(self.speed_vertical);
21690 __tmp.put_u8(self.target_system);
21691 __tmp.put_u8(self.target_component);
21692 for val in &self.id_or_mac {
21693 __tmp.put_u8(*val);
21694 }
21695 __tmp.put_u8(self.status as u8);
21696 __tmp.put_u8(self.height_reference as u8);
21697 __tmp.put_u8(self.horizontal_accuracy as u8);
21698 __tmp.put_u8(self.vertical_accuracy as u8);
21699 __tmp.put_u8(self.barometer_accuracy as u8);
21700 __tmp.put_u8(self.speed_accuracy as u8);
21701 __tmp.put_u8(self.timestamp_accuracy as u8);
21702 if matches!(version, MavlinkVersion::V2) {
21703 let len = __tmp.len();
21704 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21705 } else {
21706 __tmp.len()
21707 }
21708 }
21709}
21710#[doc = "id: 12915"]
21711#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21712#[derive(Debug, Clone, PartialEq)]
21713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21715pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21716 #[doc = "System ID (0 for broadcast)."]
21717 pub target_system: u8,
21718 #[doc = "Component ID (0 for broadcast)."]
21719 pub target_component: u8,
21720 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21721 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21722 pub id_or_mac: [u8; 20],
21723 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21724 pub single_message_size: u8,
21725 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21726 pub msg_pack_size: u8,
21727 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21728 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21729 pub messages: [u8; 225],
21730}
21731impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21732 pub const ENCODED_LEN: usize = 249usize;
21733 pub const DEFAULT: Self = Self {
21734 target_system: 0_u8,
21735 target_component: 0_u8,
21736 id_or_mac: [0_u8; 20usize],
21737 single_message_size: 0_u8,
21738 msg_pack_size: 0_u8,
21739 messages: [0_u8; 225usize],
21740 };
21741 #[cfg(feature = "arbitrary")]
21742 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21743 use arbitrary::{Arbitrary, Unstructured};
21744 let mut buf = [0u8; 1024];
21745 rng.fill_bytes(&mut buf);
21746 let mut unstructured = Unstructured::new(&buf);
21747 Self::arbitrary(&mut unstructured).unwrap_or_default()
21748 }
21749}
21750impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21751 fn default() -> Self {
21752 Self::DEFAULT.clone()
21753 }
21754}
21755impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21756 type Message = MavMessage;
21757 const ID: u32 = 12915u32;
21758 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21759 const EXTRA_CRC: u8 = 94u8;
21760 const ENCODED_LEN: usize = 249usize;
21761 fn deser(
21762 _version: MavlinkVersion,
21763 __input: &[u8],
21764 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21765 let avail_len = __input.len();
21766 let mut payload_buf = [0; Self::ENCODED_LEN];
21767 let mut buf = if avail_len < Self::ENCODED_LEN {
21768 payload_buf[0..avail_len].copy_from_slice(__input);
21769 Bytes::new(&payload_buf)
21770 } else {
21771 Bytes::new(__input)
21772 };
21773 let mut __struct = Self::default();
21774 __struct.target_system = buf.get_u8();
21775 __struct.target_component = buf.get_u8();
21776 for v in &mut __struct.id_or_mac {
21777 let val = buf.get_u8();
21778 *v = val;
21779 }
21780 __struct.single_message_size = buf.get_u8();
21781 __struct.msg_pack_size = buf.get_u8();
21782 for v in &mut __struct.messages {
21783 let val = buf.get_u8();
21784 *v = val;
21785 }
21786 Ok(__struct)
21787 }
21788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21789 let mut __tmp = BytesMut::new(bytes);
21790 #[allow(clippy::absurd_extreme_comparisons)]
21791 #[allow(unused_comparisons)]
21792 if __tmp.remaining() < Self::ENCODED_LEN {
21793 panic!(
21794 "buffer is too small (need {} bytes, but got {})",
21795 Self::ENCODED_LEN,
21796 __tmp.remaining(),
21797 )
21798 }
21799 __tmp.put_u8(self.target_system);
21800 __tmp.put_u8(self.target_component);
21801 for val in &self.id_or_mac {
21802 __tmp.put_u8(*val);
21803 }
21804 __tmp.put_u8(self.single_message_size);
21805 __tmp.put_u8(self.msg_pack_size);
21806 for val in &self.messages {
21807 __tmp.put_u8(*val);
21808 }
21809 if matches!(version, MavlinkVersion::V2) {
21810 let len = __tmp.len();
21811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21812 } else {
21813 __tmp.len()
21814 }
21815 }
21816}
21817#[doc = "id: 12905"]
21818#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21819#[derive(Debug, Clone, PartialEq)]
21820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21822pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21823 #[doc = "System ID (0 for broadcast)."]
21824 pub target_system: u8,
21825 #[doc = "Component ID (0 for broadcast)."]
21826 pub target_component: u8,
21827 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21828 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21829 pub id_or_mac: [u8; 20],
21830 #[doc = "Indicates the type of the operator_id field."]
21831 pub operator_id_type: MavOdidOperatorIdType,
21832 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21833 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21834 pub operator_id: [u8; 20],
21835}
21836impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21837 pub const ENCODED_LEN: usize = 43usize;
21838 pub const DEFAULT: Self = Self {
21839 target_system: 0_u8,
21840 target_component: 0_u8,
21841 id_or_mac: [0_u8; 20usize],
21842 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21843 operator_id: [0_u8; 20usize],
21844 };
21845 #[cfg(feature = "arbitrary")]
21846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21847 use arbitrary::{Arbitrary, Unstructured};
21848 let mut buf = [0u8; 1024];
21849 rng.fill_bytes(&mut buf);
21850 let mut unstructured = Unstructured::new(&buf);
21851 Self::arbitrary(&mut unstructured).unwrap_or_default()
21852 }
21853}
21854impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21855 fn default() -> Self {
21856 Self::DEFAULT.clone()
21857 }
21858}
21859impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21860 type Message = MavMessage;
21861 const ID: u32 = 12905u32;
21862 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21863 const EXTRA_CRC: u8 = 49u8;
21864 const ENCODED_LEN: usize = 43usize;
21865 fn deser(
21866 _version: MavlinkVersion,
21867 __input: &[u8],
21868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21869 let avail_len = __input.len();
21870 let mut payload_buf = [0; Self::ENCODED_LEN];
21871 let mut buf = if avail_len < Self::ENCODED_LEN {
21872 payload_buf[0..avail_len].copy_from_slice(__input);
21873 Bytes::new(&payload_buf)
21874 } else {
21875 Bytes::new(__input)
21876 };
21877 let mut __struct = Self::default();
21878 __struct.target_system = buf.get_u8();
21879 __struct.target_component = buf.get_u8();
21880 for v in &mut __struct.id_or_mac {
21881 let val = buf.get_u8();
21882 *v = val;
21883 }
21884 let tmp = buf.get_u8();
21885 __struct.operator_id_type =
21886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21887 enum_type: "MavOdidOperatorIdType",
21888 value: tmp as u32,
21889 })?;
21890 for v in &mut __struct.operator_id {
21891 let val = buf.get_u8();
21892 *v = val;
21893 }
21894 Ok(__struct)
21895 }
21896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21897 let mut __tmp = BytesMut::new(bytes);
21898 #[allow(clippy::absurd_extreme_comparisons)]
21899 #[allow(unused_comparisons)]
21900 if __tmp.remaining() < Self::ENCODED_LEN {
21901 panic!(
21902 "buffer is too small (need {} bytes, but got {})",
21903 Self::ENCODED_LEN,
21904 __tmp.remaining(),
21905 )
21906 }
21907 __tmp.put_u8(self.target_system);
21908 __tmp.put_u8(self.target_component);
21909 for val in &self.id_or_mac {
21910 __tmp.put_u8(*val);
21911 }
21912 __tmp.put_u8(self.operator_id_type as u8);
21913 for val in &self.operator_id {
21914 __tmp.put_u8(*val);
21915 }
21916 if matches!(version, MavlinkVersion::V2) {
21917 let len = __tmp.len();
21918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21919 } else {
21920 __tmp.len()
21921 }
21922 }
21923}
21924#[doc = "id: 12903"]
21925#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21926#[derive(Debug, Clone, PartialEq)]
21927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21929pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21930 #[doc = "System ID (0 for broadcast)."]
21931 pub target_system: u8,
21932 #[doc = "Component ID (0 for broadcast)."]
21933 pub target_component: u8,
21934 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21935 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21936 pub id_or_mac: [u8; 20],
21937 #[doc = "Indicates the type of the description field."]
21938 pub description_type: MavOdidDescType,
21939 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21941 pub description: [u8; 23],
21942}
21943impl OPEN_DRONE_ID_SELF_ID_DATA {
21944 pub const ENCODED_LEN: usize = 46usize;
21945 pub const DEFAULT: Self = Self {
21946 target_system: 0_u8,
21947 target_component: 0_u8,
21948 id_or_mac: [0_u8; 20usize],
21949 description_type: MavOdidDescType::DEFAULT,
21950 description: [0_u8; 23usize],
21951 };
21952 #[cfg(feature = "arbitrary")]
21953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21954 use arbitrary::{Arbitrary, Unstructured};
21955 let mut buf = [0u8; 1024];
21956 rng.fill_bytes(&mut buf);
21957 let mut unstructured = Unstructured::new(&buf);
21958 Self::arbitrary(&mut unstructured).unwrap_or_default()
21959 }
21960}
21961impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21962 fn default() -> Self {
21963 Self::DEFAULT.clone()
21964 }
21965}
21966impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21967 type Message = MavMessage;
21968 const ID: u32 = 12903u32;
21969 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21970 const EXTRA_CRC: u8 = 249u8;
21971 const ENCODED_LEN: usize = 46usize;
21972 fn deser(
21973 _version: MavlinkVersion,
21974 __input: &[u8],
21975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21976 let avail_len = __input.len();
21977 let mut payload_buf = [0; Self::ENCODED_LEN];
21978 let mut buf = if avail_len < Self::ENCODED_LEN {
21979 payload_buf[0..avail_len].copy_from_slice(__input);
21980 Bytes::new(&payload_buf)
21981 } else {
21982 Bytes::new(__input)
21983 };
21984 let mut __struct = Self::default();
21985 __struct.target_system = buf.get_u8();
21986 __struct.target_component = buf.get_u8();
21987 for v in &mut __struct.id_or_mac {
21988 let val = buf.get_u8();
21989 *v = val;
21990 }
21991 let tmp = buf.get_u8();
21992 __struct.description_type =
21993 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21994 enum_type: "MavOdidDescType",
21995 value: tmp as u32,
21996 })?;
21997 for v in &mut __struct.description {
21998 let val = buf.get_u8();
21999 *v = val;
22000 }
22001 Ok(__struct)
22002 }
22003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22004 let mut __tmp = BytesMut::new(bytes);
22005 #[allow(clippy::absurd_extreme_comparisons)]
22006 #[allow(unused_comparisons)]
22007 if __tmp.remaining() < Self::ENCODED_LEN {
22008 panic!(
22009 "buffer is too small (need {} bytes, but got {})",
22010 Self::ENCODED_LEN,
22011 __tmp.remaining(),
22012 )
22013 }
22014 __tmp.put_u8(self.target_system);
22015 __tmp.put_u8(self.target_component);
22016 for val in &self.id_or_mac {
22017 __tmp.put_u8(*val);
22018 }
22019 __tmp.put_u8(self.description_type as u8);
22020 for val in &self.description {
22021 __tmp.put_u8(*val);
22022 }
22023 if matches!(version, MavlinkVersion::V2) {
22024 let len = __tmp.len();
22025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22026 } else {
22027 __tmp.len()
22028 }
22029 }
22030}
22031#[doc = "id: 12904"]
22032#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22033#[derive(Debug, Clone, PartialEq)]
22034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22036pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22037 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22038 pub operator_latitude: i32,
22039 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22040 pub operator_longitude: i32,
22041 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22042 pub area_ceiling: f32,
22043 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22044 pub area_floor: f32,
22045 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22046 pub operator_altitude_geo: f32,
22047 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22048 pub timestamp: u32,
22049 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22050 pub area_count: u16,
22051 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22052 pub area_radius: u16,
22053 #[doc = "System ID (0 for broadcast)."]
22054 pub target_system: u8,
22055 #[doc = "Component ID (0 for broadcast)."]
22056 pub target_component: u8,
22057 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22058 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22059 pub id_or_mac: [u8; 20],
22060 #[doc = "Specifies the operator location type."]
22061 pub operator_location_type: MavOdidOperatorLocationType,
22062 #[doc = "Specifies the classification type of the UA."]
22063 pub classification_type: MavOdidClassificationType,
22064 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22065 pub category_eu: MavOdidCategoryEu,
22066 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22067 pub class_eu: MavOdidClassEu,
22068}
22069impl OPEN_DRONE_ID_SYSTEM_DATA {
22070 pub const ENCODED_LEN: usize = 54usize;
22071 pub const DEFAULT: Self = Self {
22072 operator_latitude: 0_i32,
22073 operator_longitude: 0_i32,
22074 area_ceiling: 0.0_f32,
22075 area_floor: 0.0_f32,
22076 operator_altitude_geo: 0.0_f32,
22077 timestamp: 0_u32,
22078 area_count: 0_u16,
22079 area_radius: 0_u16,
22080 target_system: 0_u8,
22081 target_component: 0_u8,
22082 id_or_mac: [0_u8; 20usize],
22083 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22084 classification_type: MavOdidClassificationType::DEFAULT,
22085 category_eu: MavOdidCategoryEu::DEFAULT,
22086 class_eu: MavOdidClassEu::DEFAULT,
22087 };
22088 #[cfg(feature = "arbitrary")]
22089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22090 use arbitrary::{Arbitrary, Unstructured};
22091 let mut buf = [0u8; 1024];
22092 rng.fill_bytes(&mut buf);
22093 let mut unstructured = Unstructured::new(&buf);
22094 Self::arbitrary(&mut unstructured).unwrap_or_default()
22095 }
22096}
22097impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22098 fn default() -> Self {
22099 Self::DEFAULT.clone()
22100 }
22101}
22102impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22103 type Message = MavMessage;
22104 const ID: u32 = 12904u32;
22105 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22106 const EXTRA_CRC: u8 = 77u8;
22107 const ENCODED_LEN: usize = 54usize;
22108 fn deser(
22109 _version: MavlinkVersion,
22110 __input: &[u8],
22111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22112 let avail_len = __input.len();
22113 let mut payload_buf = [0; Self::ENCODED_LEN];
22114 let mut buf = if avail_len < Self::ENCODED_LEN {
22115 payload_buf[0..avail_len].copy_from_slice(__input);
22116 Bytes::new(&payload_buf)
22117 } else {
22118 Bytes::new(__input)
22119 };
22120 let mut __struct = Self::default();
22121 __struct.operator_latitude = buf.get_i32_le();
22122 __struct.operator_longitude = buf.get_i32_le();
22123 __struct.area_ceiling = buf.get_f32_le();
22124 __struct.area_floor = buf.get_f32_le();
22125 __struct.operator_altitude_geo = buf.get_f32_le();
22126 __struct.timestamp = buf.get_u32_le();
22127 __struct.area_count = buf.get_u16_le();
22128 __struct.area_radius = buf.get_u16_le();
22129 __struct.target_system = buf.get_u8();
22130 __struct.target_component = buf.get_u8();
22131 for v in &mut __struct.id_or_mac {
22132 let val = buf.get_u8();
22133 *v = val;
22134 }
22135 let tmp = buf.get_u8();
22136 __struct.operator_location_type =
22137 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22138 enum_type: "MavOdidOperatorLocationType",
22139 value: tmp as u32,
22140 })?;
22141 let tmp = buf.get_u8();
22142 __struct.classification_type =
22143 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22144 enum_type: "MavOdidClassificationType",
22145 value: tmp as u32,
22146 })?;
22147 let tmp = buf.get_u8();
22148 __struct.category_eu =
22149 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22150 enum_type: "MavOdidCategoryEu",
22151 value: tmp as u32,
22152 })?;
22153 let tmp = buf.get_u8();
22154 __struct.class_eu =
22155 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22156 enum_type: "MavOdidClassEu",
22157 value: tmp as u32,
22158 })?;
22159 Ok(__struct)
22160 }
22161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22162 let mut __tmp = BytesMut::new(bytes);
22163 #[allow(clippy::absurd_extreme_comparisons)]
22164 #[allow(unused_comparisons)]
22165 if __tmp.remaining() < Self::ENCODED_LEN {
22166 panic!(
22167 "buffer is too small (need {} bytes, but got {})",
22168 Self::ENCODED_LEN,
22169 __tmp.remaining(),
22170 )
22171 }
22172 __tmp.put_i32_le(self.operator_latitude);
22173 __tmp.put_i32_le(self.operator_longitude);
22174 __tmp.put_f32_le(self.area_ceiling);
22175 __tmp.put_f32_le(self.area_floor);
22176 __tmp.put_f32_le(self.operator_altitude_geo);
22177 __tmp.put_u32_le(self.timestamp);
22178 __tmp.put_u16_le(self.area_count);
22179 __tmp.put_u16_le(self.area_radius);
22180 __tmp.put_u8(self.target_system);
22181 __tmp.put_u8(self.target_component);
22182 for val in &self.id_or_mac {
22183 __tmp.put_u8(*val);
22184 }
22185 __tmp.put_u8(self.operator_location_type as u8);
22186 __tmp.put_u8(self.classification_type as u8);
22187 __tmp.put_u8(self.category_eu as u8);
22188 __tmp.put_u8(self.class_eu as u8);
22189 if matches!(version, MavlinkVersion::V2) {
22190 let len = __tmp.len();
22191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22192 } else {
22193 __tmp.len()
22194 }
22195 }
22196}
22197#[doc = "id: 12919"]
22198#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22199#[derive(Debug, Clone, PartialEq)]
22200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22202pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22203 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22204 pub operator_latitude: i32,
22205 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22206 pub operator_longitude: i32,
22207 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22208 pub operator_altitude_geo: f32,
22209 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22210 pub timestamp: u32,
22211 #[doc = "System ID (0 for broadcast)."]
22212 pub target_system: u8,
22213 #[doc = "Component ID (0 for broadcast)."]
22214 pub target_component: u8,
22215}
22216impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22217 pub const ENCODED_LEN: usize = 18usize;
22218 pub const DEFAULT: Self = Self {
22219 operator_latitude: 0_i32,
22220 operator_longitude: 0_i32,
22221 operator_altitude_geo: 0.0_f32,
22222 timestamp: 0_u32,
22223 target_system: 0_u8,
22224 target_component: 0_u8,
22225 };
22226 #[cfg(feature = "arbitrary")]
22227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22228 use arbitrary::{Arbitrary, Unstructured};
22229 let mut buf = [0u8; 1024];
22230 rng.fill_bytes(&mut buf);
22231 let mut unstructured = Unstructured::new(&buf);
22232 Self::arbitrary(&mut unstructured).unwrap_or_default()
22233 }
22234}
22235impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22236 fn default() -> Self {
22237 Self::DEFAULT.clone()
22238 }
22239}
22240impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22241 type Message = MavMessage;
22242 const ID: u32 = 12919u32;
22243 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22244 const EXTRA_CRC: u8 = 7u8;
22245 const ENCODED_LEN: usize = 18usize;
22246 fn deser(
22247 _version: MavlinkVersion,
22248 __input: &[u8],
22249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22250 let avail_len = __input.len();
22251 let mut payload_buf = [0; Self::ENCODED_LEN];
22252 let mut buf = if avail_len < Self::ENCODED_LEN {
22253 payload_buf[0..avail_len].copy_from_slice(__input);
22254 Bytes::new(&payload_buf)
22255 } else {
22256 Bytes::new(__input)
22257 };
22258 let mut __struct = Self::default();
22259 __struct.operator_latitude = buf.get_i32_le();
22260 __struct.operator_longitude = buf.get_i32_le();
22261 __struct.operator_altitude_geo = buf.get_f32_le();
22262 __struct.timestamp = buf.get_u32_le();
22263 __struct.target_system = buf.get_u8();
22264 __struct.target_component = buf.get_u8();
22265 Ok(__struct)
22266 }
22267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22268 let mut __tmp = BytesMut::new(bytes);
22269 #[allow(clippy::absurd_extreme_comparisons)]
22270 #[allow(unused_comparisons)]
22271 if __tmp.remaining() < Self::ENCODED_LEN {
22272 panic!(
22273 "buffer is too small (need {} bytes, but got {})",
22274 Self::ENCODED_LEN,
22275 __tmp.remaining(),
22276 )
22277 }
22278 __tmp.put_i32_le(self.operator_latitude);
22279 __tmp.put_i32_le(self.operator_longitude);
22280 __tmp.put_f32_le(self.operator_altitude_geo);
22281 __tmp.put_u32_le(self.timestamp);
22282 __tmp.put_u8(self.target_system);
22283 __tmp.put_u8(self.target_component);
22284 if matches!(version, MavlinkVersion::V2) {
22285 let len = __tmp.len();
22286 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22287 } else {
22288 __tmp.len()
22289 }
22290 }
22291}
22292#[doc = "id: 100"]
22293#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22294#[derive(Debug, Clone, PartialEq)]
22295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22297pub struct OPTICAL_FLOW_DATA {
22298 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22299 pub time_usec: u64,
22300 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22301 pub flow_comp_m_x: f32,
22302 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22303 pub flow_comp_m_y: f32,
22304 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22305 pub ground_distance: f32,
22306 #[doc = "Flow in x-sensor direction"]
22307 pub flow_x: i16,
22308 #[doc = "Flow in y-sensor direction"]
22309 pub flow_y: i16,
22310 #[doc = "Sensor ID"]
22311 pub sensor_id: u8,
22312 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22313 pub quality: u8,
22314 #[doc = "Flow rate about X axis"]
22315 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22316 pub flow_rate_x: f32,
22317 #[doc = "Flow rate about Y axis"]
22318 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22319 pub flow_rate_y: f32,
22320}
22321impl OPTICAL_FLOW_DATA {
22322 pub const ENCODED_LEN: usize = 34usize;
22323 pub const DEFAULT: Self = Self {
22324 time_usec: 0_u64,
22325 flow_comp_m_x: 0.0_f32,
22326 flow_comp_m_y: 0.0_f32,
22327 ground_distance: 0.0_f32,
22328 flow_x: 0_i16,
22329 flow_y: 0_i16,
22330 sensor_id: 0_u8,
22331 quality: 0_u8,
22332 flow_rate_x: 0.0_f32,
22333 flow_rate_y: 0.0_f32,
22334 };
22335 #[cfg(feature = "arbitrary")]
22336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22337 use arbitrary::{Arbitrary, Unstructured};
22338 let mut buf = [0u8; 1024];
22339 rng.fill_bytes(&mut buf);
22340 let mut unstructured = Unstructured::new(&buf);
22341 Self::arbitrary(&mut unstructured).unwrap_or_default()
22342 }
22343}
22344impl Default for OPTICAL_FLOW_DATA {
22345 fn default() -> Self {
22346 Self::DEFAULT.clone()
22347 }
22348}
22349impl MessageData for OPTICAL_FLOW_DATA {
22350 type Message = MavMessage;
22351 const ID: u32 = 100u32;
22352 const NAME: &'static str = "OPTICAL_FLOW";
22353 const EXTRA_CRC: u8 = 175u8;
22354 const ENCODED_LEN: usize = 34usize;
22355 fn deser(
22356 _version: MavlinkVersion,
22357 __input: &[u8],
22358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22359 let avail_len = __input.len();
22360 let mut payload_buf = [0; Self::ENCODED_LEN];
22361 let mut buf = if avail_len < Self::ENCODED_LEN {
22362 payload_buf[0..avail_len].copy_from_slice(__input);
22363 Bytes::new(&payload_buf)
22364 } else {
22365 Bytes::new(__input)
22366 };
22367 let mut __struct = Self::default();
22368 __struct.time_usec = buf.get_u64_le();
22369 __struct.flow_comp_m_x = buf.get_f32_le();
22370 __struct.flow_comp_m_y = buf.get_f32_le();
22371 __struct.ground_distance = buf.get_f32_le();
22372 __struct.flow_x = buf.get_i16_le();
22373 __struct.flow_y = buf.get_i16_le();
22374 __struct.sensor_id = buf.get_u8();
22375 __struct.quality = buf.get_u8();
22376 __struct.flow_rate_x = buf.get_f32_le();
22377 __struct.flow_rate_y = buf.get_f32_le();
22378 Ok(__struct)
22379 }
22380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22381 let mut __tmp = BytesMut::new(bytes);
22382 #[allow(clippy::absurd_extreme_comparisons)]
22383 #[allow(unused_comparisons)]
22384 if __tmp.remaining() < Self::ENCODED_LEN {
22385 panic!(
22386 "buffer is too small (need {} bytes, but got {})",
22387 Self::ENCODED_LEN,
22388 __tmp.remaining(),
22389 )
22390 }
22391 __tmp.put_u64_le(self.time_usec);
22392 __tmp.put_f32_le(self.flow_comp_m_x);
22393 __tmp.put_f32_le(self.flow_comp_m_y);
22394 __tmp.put_f32_le(self.ground_distance);
22395 __tmp.put_i16_le(self.flow_x);
22396 __tmp.put_i16_le(self.flow_y);
22397 __tmp.put_u8(self.sensor_id);
22398 __tmp.put_u8(self.quality);
22399 __tmp.put_f32_le(self.flow_rate_x);
22400 __tmp.put_f32_le(self.flow_rate_y);
22401 if matches!(version, MavlinkVersion::V2) {
22402 let len = __tmp.len();
22403 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22404 } else {
22405 __tmp.len()
22406 }
22407 }
22408}
22409#[doc = "id: 106"]
22410#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22411#[derive(Debug, Clone, PartialEq)]
22412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22414pub struct OPTICAL_FLOW_RAD_DATA {
22415 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22416 pub time_usec: u64,
22417 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22418 pub integration_time_us: u32,
22419 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22420 pub integrated_x: f32,
22421 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22422 pub integrated_y: f32,
22423 #[doc = "RH rotation around X axis"]
22424 pub integrated_xgyro: f32,
22425 #[doc = "RH rotation around Y axis"]
22426 pub integrated_ygyro: f32,
22427 #[doc = "RH rotation around Z axis"]
22428 pub integrated_zgyro: f32,
22429 #[doc = "Time since the distance was sampled."]
22430 pub time_delta_distance_us: u32,
22431 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22432 pub distance: f32,
22433 #[doc = "Temperature"]
22434 pub temperature: i16,
22435 #[doc = "Sensor ID"]
22436 pub sensor_id: u8,
22437 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22438 pub quality: u8,
22439}
22440impl OPTICAL_FLOW_RAD_DATA {
22441 pub const ENCODED_LEN: usize = 44usize;
22442 pub const DEFAULT: Self = Self {
22443 time_usec: 0_u64,
22444 integration_time_us: 0_u32,
22445 integrated_x: 0.0_f32,
22446 integrated_y: 0.0_f32,
22447 integrated_xgyro: 0.0_f32,
22448 integrated_ygyro: 0.0_f32,
22449 integrated_zgyro: 0.0_f32,
22450 time_delta_distance_us: 0_u32,
22451 distance: 0.0_f32,
22452 temperature: 0_i16,
22453 sensor_id: 0_u8,
22454 quality: 0_u8,
22455 };
22456 #[cfg(feature = "arbitrary")]
22457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22458 use arbitrary::{Arbitrary, Unstructured};
22459 let mut buf = [0u8; 1024];
22460 rng.fill_bytes(&mut buf);
22461 let mut unstructured = Unstructured::new(&buf);
22462 Self::arbitrary(&mut unstructured).unwrap_or_default()
22463 }
22464}
22465impl Default for OPTICAL_FLOW_RAD_DATA {
22466 fn default() -> Self {
22467 Self::DEFAULT.clone()
22468 }
22469}
22470impl MessageData for OPTICAL_FLOW_RAD_DATA {
22471 type Message = MavMessage;
22472 const ID: u32 = 106u32;
22473 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22474 const EXTRA_CRC: u8 = 138u8;
22475 const ENCODED_LEN: usize = 44usize;
22476 fn deser(
22477 _version: MavlinkVersion,
22478 __input: &[u8],
22479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22480 let avail_len = __input.len();
22481 let mut payload_buf = [0; Self::ENCODED_LEN];
22482 let mut buf = if avail_len < Self::ENCODED_LEN {
22483 payload_buf[0..avail_len].copy_from_slice(__input);
22484 Bytes::new(&payload_buf)
22485 } else {
22486 Bytes::new(__input)
22487 };
22488 let mut __struct = Self::default();
22489 __struct.time_usec = buf.get_u64_le();
22490 __struct.integration_time_us = buf.get_u32_le();
22491 __struct.integrated_x = buf.get_f32_le();
22492 __struct.integrated_y = buf.get_f32_le();
22493 __struct.integrated_xgyro = buf.get_f32_le();
22494 __struct.integrated_ygyro = buf.get_f32_le();
22495 __struct.integrated_zgyro = buf.get_f32_le();
22496 __struct.time_delta_distance_us = buf.get_u32_le();
22497 __struct.distance = buf.get_f32_le();
22498 __struct.temperature = buf.get_i16_le();
22499 __struct.sensor_id = buf.get_u8();
22500 __struct.quality = buf.get_u8();
22501 Ok(__struct)
22502 }
22503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22504 let mut __tmp = BytesMut::new(bytes);
22505 #[allow(clippy::absurd_extreme_comparisons)]
22506 #[allow(unused_comparisons)]
22507 if __tmp.remaining() < Self::ENCODED_LEN {
22508 panic!(
22509 "buffer is too small (need {} bytes, but got {})",
22510 Self::ENCODED_LEN,
22511 __tmp.remaining(),
22512 )
22513 }
22514 __tmp.put_u64_le(self.time_usec);
22515 __tmp.put_u32_le(self.integration_time_us);
22516 __tmp.put_f32_le(self.integrated_x);
22517 __tmp.put_f32_le(self.integrated_y);
22518 __tmp.put_f32_le(self.integrated_xgyro);
22519 __tmp.put_f32_le(self.integrated_ygyro);
22520 __tmp.put_f32_le(self.integrated_zgyro);
22521 __tmp.put_u32_le(self.time_delta_distance_us);
22522 __tmp.put_f32_le(self.distance);
22523 __tmp.put_i16_le(self.temperature);
22524 __tmp.put_u8(self.sensor_id);
22525 __tmp.put_u8(self.quality);
22526 if matches!(version, MavlinkVersion::V2) {
22527 let len = __tmp.len();
22528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22529 } else {
22530 __tmp.len()
22531 }
22532 }
22533}
22534#[doc = "id: 360"]
22535#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22536#[derive(Debug, Clone, PartialEq)]
22537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22538#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22539pub struct ORBIT_EXECUTION_STATUS_DATA {
22540 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22541 pub time_usec: u64,
22542 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22543 pub radius: f32,
22544 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22545 pub x: i32,
22546 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22547 pub y: i32,
22548 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22549 pub z: f32,
22550 #[doc = "The coordinate system of the fields: x, y, z."]
22551 pub frame: MavFrame,
22552}
22553impl ORBIT_EXECUTION_STATUS_DATA {
22554 pub const ENCODED_LEN: usize = 25usize;
22555 pub const DEFAULT: Self = Self {
22556 time_usec: 0_u64,
22557 radius: 0.0_f32,
22558 x: 0_i32,
22559 y: 0_i32,
22560 z: 0.0_f32,
22561 frame: MavFrame::DEFAULT,
22562 };
22563 #[cfg(feature = "arbitrary")]
22564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22565 use arbitrary::{Arbitrary, Unstructured};
22566 let mut buf = [0u8; 1024];
22567 rng.fill_bytes(&mut buf);
22568 let mut unstructured = Unstructured::new(&buf);
22569 Self::arbitrary(&mut unstructured).unwrap_or_default()
22570 }
22571}
22572impl Default for ORBIT_EXECUTION_STATUS_DATA {
22573 fn default() -> Self {
22574 Self::DEFAULT.clone()
22575 }
22576}
22577impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22578 type Message = MavMessage;
22579 const ID: u32 = 360u32;
22580 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22581 const EXTRA_CRC: u8 = 11u8;
22582 const ENCODED_LEN: usize = 25usize;
22583 fn deser(
22584 _version: MavlinkVersion,
22585 __input: &[u8],
22586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22587 let avail_len = __input.len();
22588 let mut payload_buf = [0; Self::ENCODED_LEN];
22589 let mut buf = if avail_len < Self::ENCODED_LEN {
22590 payload_buf[0..avail_len].copy_from_slice(__input);
22591 Bytes::new(&payload_buf)
22592 } else {
22593 Bytes::new(__input)
22594 };
22595 let mut __struct = Self::default();
22596 __struct.time_usec = buf.get_u64_le();
22597 __struct.radius = buf.get_f32_le();
22598 __struct.x = buf.get_i32_le();
22599 __struct.y = buf.get_i32_le();
22600 __struct.z = buf.get_f32_le();
22601 let tmp = buf.get_u8();
22602 __struct.frame =
22603 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22604 enum_type: "MavFrame",
22605 value: tmp as u32,
22606 })?;
22607 Ok(__struct)
22608 }
22609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22610 let mut __tmp = BytesMut::new(bytes);
22611 #[allow(clippy::absurd_extreme_comparisons)]
22612 #[allow(unused_comparisons)]
22613 if __tmp.remaining() < Self::ENCODED_LEN {
22614 panic!(
22615 "buffer is too small (need {} bytes, but got {})",
22616 Self::ENCODED_LEN,
22617 __tmp.remaining(),
22618 )
22619 }
22620 __tmp.put_u64_le(self.time_usec);
22621 __tmp.put_f32_le(self.radius);
22622 __tmp.put_i32_le(self.x);
22623 __tmp.put_i32_le(self.y);
22624 __tmp.put_f32_le(self.z);
22625 __tmp.put_u8(self.frame as u8);
22626 if matches!(version, MavlinkVersion::V2) {
22627 let len = __tmp.len();
22628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22629 } else {
22630 __tmp.len()
22631 }
22632 }
22633}
22634#[doc = "id: 324"]
22635#[doc = "Response from a PARAM_EXT_SET message."]
22636#[derive(Debug, Clone, PartialEq)]
22637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22639pub struct PARAM_EXT_ACK_DATA {
22640 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22642 pub param_id: [u8; 16],
22643 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22644 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22645 pub param_value: [u8; 128],
22646 #[doc = "Parameter type."]
22647 pub param_type: MavParamExtType,
22648 #[doc = "Result code."]
22649 pub param_result: ParamAck,
22650}
22651impl PARAM_EXT_ACK_DATA {
22652 pub const ENCODED_LEN: usize = 146usize;
22653 pub const DEFAULT: Self = Self {
22654 param_id: [0_u8; 16usize],
22655 param_value: [0_u8; 128usize],
22656 param_type: MavParamExtType::DEFAULT,
22657 param_result: ParamAck::DEFAULT,
22658 };
22659 #[cfg(feature = "arbitrary")]
22660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22661 use arbitrary::{Arbitrary, Unstructured};
22662 let mut buf = [0u8; 1024];
22663 rng.fill_bytes(&mut buf);
22664 let mut unstructured = Unstructured::new(&buf);
22665 Self::arbitrary(&mut unstructured).unwrap_or_default()
22666 }
22667}
22668impl Default for PARAM_EXT_ACK_DATA {
22669 fn default() -> Self {
22670 Self::DEFAULT.clone()
22671 }
22672}
22673impl MessageData for PARAM_EXT_ACK_DATA {
22674 type Message = MavMessage;
22675 const ID: u32 = 324u32;
22676 const NAME: &'static str = "PARAM_EXT_ACK";
22677 const EXTRA_CRC: u8 = 132u8;
22678 const ENCODED_LEN: usize = 146usize;
22679 fn deser(
22680 _version: MavlinkVersion,
22681 __input: &[u8],
22682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22683 let avail_len = __input.len();
22684 let mut payload_buf = [0; Self::ENCODED_LEN];
22685 let mut buf = if avail_len < Self::ENCODED_LEN {
22686 payload_buf[0..avail_len].copy_from_slice(__input);
22687 Bytes::new(&payload_buf)
22688 } else {
22689 Bytes::new(__input)
22690 };
22691 let mut __struct = Self::default();
22692 for v in &mut __struct.param_id {
22693 let val = buf.get_u8();
22694 *v = val;
22695 }
22696 for v in &mut __struct.param_value {
22697 let val = buf.get_u8();
22698 *v = val;
22699 }
22700 let tmp = buf.get_u8();
22701 __struct.param_type =
22702 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22703 enum_type: "MavParamExtType",
22704 value: tmp as u32,
22705 })?;
22706 let tmp = buf.get_u8();
22707 __struct.param_result =
22708 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22709 enum_type: "ParamAck",
22710 value: tmp as u32,
22711 })?;
22712 Ok(__struct)
22713 }
22714 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22715 let mut __tmp = BytesMut::new(bytes);
22716 #[allow(clippy::absurd_extreme_comparisons)]
22717 #[allow(unused_comparisons)]
22718 if __tmp.remaining() < Self::ENCODED_LEN {
22719 panic!(
22720 "buffer is too small (need {} bytes, but got {})",
22721 Self::ENCODED_LEN,
22722 __tmp.remaining(),
22723 )
22724 }
22725 for val in &self.param_id {
22726 __tmp.put_u8(*val);
22727 }
22728 for val in &self.param_value {
22729 __tmp.put_u8(*val);
22730 }
22731 __tmp.put_u8(self.param_type as u8);
22732 __tmp.put_u8(self.param_result as u8);
22733 if matches!(version, MavlinkVersion::V2) {
22734 let len = __tmp.len();
22735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22736 } else {
22737 __tmp.len()
22738 }
22739 }
22740}
22741#[doc = "id: 321"]
22742#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22743#[derive(Debug, Clone, PartialEq)]
22744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22746pub struct PARAM_EXT_REQUEST_LIST_DATA {
22747 #[doc = "System ID"]
22748 pub target_system: u8,
22749 #[doc = "Component ID"]
22750 pub target_component: u8,
22751}
22752impl PARAM_EXT_REQUEST_LIST_DATA {
22753 pub const ENCODED_LEN: usize = 2usize;
22754 pub const DEFAULT: Self = Self {
22755 target_system: 0_u8,
22756 target_component: 0_u8,
22757 };
22758 #[cfg(feature = "arbitrary")]
22759 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22760 use arbitrary::{Arbitrary, Unstructured};
22761 let mut buf = [0u8; 1024];
22762 rng.fill_bytes(&mut buf);
22763 let mut unstructured = Unstructured::new(&buf);
22764 Self::arbitrary(&mut unstructured).unwrap_or_default()
22765 }
22766}
22767impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22768 fn default() -> Self {
22769 Self::DEFAULT.clone()
22770 }
22771}
22772impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22773 type Message = MavMessage;
22774 const ID: u32 = 321u32;
22775 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22776 const EXTRA_CRC: u8 = 88u8;
22777 const ENCODED_LEN: usize = 2usize;
22778 fn deser(
22779 _version: MavlinkVersion,
22780 __input: &[u8],
22781 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22782 let avail_len = __input.len();
22783 let mut payload_buf = [0; Self::ENCODED_LEN];
22784 let mut buf = if avail_len < Self::ENCODED_LEN {
22785 payload_buf[0..avail_len].copy_from_slice(__input);
22786 Bytes::new(&payload_buf)
22787 } else {
22788 Bytes::new(__input)
22789 };
22790 let mut __struct = Self::default();
22791 __struct.target_system = buf.get_u8();
22792 __struct.target_component = buf.get_u8();
22793 Ok(__struct)
22794 }
22795 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22796 let mut __tmp = BytesMut::new(bytes);
22797 #[allow(clippy::absurd_extreme_comparisons)]
22798 #[allow(unused_comparisons)]
22799 if __tmp.remaining() < Self::ENCODED_LEN {
22800 panic!(
22801 "buffer is too small (need {} bytes, but got {})",
22802 Self::ENCODED_LEN,
22803 __tmp.remaining(),
22804 )
22805 }
22806 __tmp.put_u8(self.target_system);
22807 __tmp.put_u8(self.target_component);
22808 if matches!(version, MavlinkVersion::V2) {
22809 let len = __tmp.len();
22810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22811 } else {
22812 __tmp.len()
22813 }
22814 }
22815}
22816#[doc = "id: 320"]
22817#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22818#[derive(Debug, Clone, PartialEq)]
22819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22821pub struct PARAM_EXT_REQUEST_READ_DATA {
22822 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22823 pub param_index: i16,
22824 #[doc = "System ID"]
22825 pub target_system: u8,
22826 #[doc = "Component ID"]
22827 pub target_component: u8,
22828 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22830 pub param_id: [u8; 16],
22831}
22832impl PARAM_EXT_REQUEST_READ_DATA {
22833 pub const ENCODED_LEN: usize = 20usize;
22834 pub const DEFAULT: Self = Self {
22835 param_index: 0_i16,
22836 target_system: 0_u8,
22837 target_component: 0_u8,
22838 param_id: [0_u8; 16usize],
22839 };
22840 #[cfg(feature = "arbitrary")]
22841 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22842 use arbitrary::{Arbitrary, Unstructured};
22843 let mut buf = [0u8; 1024];
22844 rng.fill_bytes(&mut buf);
22845 let mut unstructured = Unstructured::new(&buf);
22846 Self::arbitrary(&mut unstructured).unwrap_or_default()
22847 }
22848}
22849impl Default for PARAM_EXT_REQUEST_READ_DATA {
22850 fn default() -> Self {
22851 Self::DEFAULT.clone()
22852 }
22853}
22854impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22855 type Message = MavMessage;
22856 const ID: u32 = 320u32;
22857 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22858 const EXTRA_CRC: u8 = 243u8;
22859 const ENCODED_LEN: usize = 20usize;
22860 fn deser(
22861 _version: MavlinkVersion,
22862 __input: &[u8],
22863 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22864 let avail_len = __input.len();
22865 let mut payload_buf = [0; Self::ENCODED_LEN];
22866 let mut buf = if avail_len < Self::ENCODED_LEN {
22867 payload_buf[0..avail_len].copy_from_slice(__input);
22868 Bytes::new(&payload_buf)
22869 } else {
22870 Bytes::new(__input)
22871 };
22872 let mut __struct = Self::default();
22873 __struct.param_index = buf.get_i16_le();
22874 __struct.target_system = buf.get_u8();
22875 __struct.target_component = buf.get_u8();
22876 for v in &mut __struct.param_id {
22877 let val = buf.get_u8();
22878 *v = val;
22879 }
22880 Ok(__struct)
22881 }
22882 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22883 let mut __tmp = BytesMut::new(bytes);
22884 #[allow(clippy::absurd_extreme_comparisons)]
22885 #[allow(unused_comparisons)]
22886 if __tmp.remaining() < Self::ENCODED_LEN {
22887 panic!(
22888 "buffer is too small (need {} bytes, but got {})",
22889 Self::ENCODED_LEN,
22890 __tmp.remaining(),
22891 )
22892 }
22893 __tmp.put_i16_le(self.param_index);
22894 __tmp.put_u8(self.target_system);
22895 __tmp.put_u8(self.target_component);
22896 for val in &self.param_id {
22897 __tmp.put_u8(*val);
22898 }
22899 if matches!(version, MavlinkVersion::V2) {
22900 let len = __tmp.len();
22901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22902 } else {
22903 __tmp.len()
22904 }
22905 }
22906}
22907#[doc = "id: 323"]
22908#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22909#[derive(Debug, Clone, PartialEq)]
22910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22912pub struct PARAM_EXT_SET_DATA {
22913 #[doc = "System ID"]
22914 pub target_system: u8,
22915 #[doc = "Component ID"]
22916 pub target_component: u8,
22917 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22919 pub param_id: [u8; 16],
22920 #[doc = "Parameter value"]
22921 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22922 pub param_value: [u8; 128],
22923 #[doc = "Parameter type."]
22924 pub param_type: MavParamExtType,
22925}
22926impl PARAM_EXT_SET_DATA {
22927 pub const ENCODED_LEN: usize = 147usize;
22928 pub const DEFAULT: Self = Self {
22929 target_system: 0_u8,
22930 target_component: 0_u8,
22931 param_id: [0_u8; 16usize],
22932 param_value: [0_u8; 128usize],
22933 param_type: MavParamExtType::DEFAULT,
22934 };
22935 #[cfg(feature = "arbitrary")]
22936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22937 use arbitrary::{Arbitrary, Unstructured};
22938 let mut buf = [0u8; 1024];
22939 rng.fill_bytes(&mut buf);
22940 let mut unstructured = Unstructured::new(&buf);
22941 Self::arbitrary(&mut unstructured).unwrap_or_default()
22942 }
22943}
22944impl Default for PARAM_EXT_SET_DATA {
22945 fn default() -> Self {
22946 Self::DEFAULT.clone()
22947 }
22948}
22949impl MessageData for PARAM_EXT_SET_DATA {
22950 type Message = MavMessage;
22951 const ID: u32 = 323u32;
22952 const NAME: &'static str = "PARAM_EXT_SET";
22953 const EXTRA_CRC: u8 = 78u8;
22954 const ENCODED_LEN: usize = 147usize;
22955 fn deser(
22956 _version: MavlinkVersion,
22957 __input: &[u8],
22958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22959 let avail_len = __input.len();
22960 let mut payload_buf = [0; Self::ENCODED_LEN];
22961 let mut buf = if avail_len < Self::ENCODED_LEN {
22962 payload_buf[0..avail_len].copy_from_slice(__input);
22963 Bytes::new(&payload_buf)
22964 } else {
22965 Bytes::new(__input)
22966 };
22967 let mut __struct = Self::default();
22968 __struct.target_system = buf.get_u8();
22969 __struct.target_component = buf.get_u8();
22970 for v in &mut __struct.param_id {
22971 let val = buf.get_u8();
22972 *v = val;
22973 }
22974 for v in &mut __struct.param_value {
22975 let val = buf.get_u8();
22976 *v = val;
22977 }
22978 let tmp = buf.get_u8();
22979 __struct.param_type =
22980 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22981 enum_type: "MavParamExtType",
22982 value: tmp as u32,
22983 })?;
22984 Ok(__struct)
22985 }
22986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22987 let mut __tmp = BytesMut::new(bytes);
22988 #[allow(clippy::absurd_extreme_comparisons)]
22989 #[allow(unused_comparisons)]
22990 if __tmp.remaining() < Self::ENCODED_LEN {
22991 panic!(
22992 "buffer is too small (need {} bytes, but got {})",
22993 Self::ENCODED_LEN,
22994 __tmp.remaining(),
22995 )
22996 }
22997 __tmp.put_u8(self.target_system);
22998 __tmp.put_u8(self.target_component);
22999 for val in &self.param_id {
23000 __tmp.put_u8(*val);
23001 }
23002 for val in &self.param_value {
23003 __tmp.put_u8(*val);
23004 }
23005 __tmp.put_u8(self.param_type as u8);
23006 if matches!(version, MavlinkVersion::V2) {
23007 let len = __tmp.len();
23008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23009 } else {
23010 __tmp.len()
23011 }
23012 }
23013}
23014#[doc = "id: 322"]
23015#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23016#[derive(Debug, Clone, PartialEq)]
23017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23019pub struct PARAM_EXT_VALUE_DATA {
23020 #[doc = "Total number of parameters"]
23021 pub param_count: u16,
23022 #[doc = "Index of this parameter"]
23023 pub param_index: u16,
23024 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23026 pub param_id: [u8; 16],
23027 #[doc = "Parameter value"]
23028 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23029 pub param_value: [u8; 128],
23030 #[doc = "Parameter type."]
23031 pub param_type: MavParamExtType,
23032}
23033impl PARAM_EXT_VALUE_DATA {
23034 pub const ENCODED_LEN: usize = 149usize;
23035 pub const DEFAULT: Self = Self {
23036 param_count: 0_u16,
23037 param_index: 0_u16,
23038 param_id: [0_u8; 16usize],
23039 param_value: [0_u8; 128usize],
23040 param_type: MavParamExtType::DEFAULT,
23041 };
23042 #[cfg(feature = "arbitrary")]
23043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23044 use arbitrary::{Arbitrary, Unstructured};
23045 let mut buf = [0u8; 1024];
23046 rng.fill_bytes(&mut buf);
23047 let mut unstructured = Unstructured::new(&buf);
23048 Self::arbitrary(&mut unstructured).unwrap_or_default()
23049 }
23050}
23051impl Default for PARAM_EXT_VALUE_DATA {
23052 fn default() -> Self {
23053 Self::DEFAULT.clone()
23054 }
23055}
23056impl MessageData for PARAM_EXT_VALUE_DATA {
23057 type Message = MavMessage;
23058 const ID: u32 = 322u32;
23059 const NAME: &'static str = "PARAM_EXT_VALUE";
23060 const EXTRA_CRC: u8 = 243u8;
23061 const ENCODED_LEN: usize = 149usize;
23062 fn deser(
23063 _version: MavlinkVersion,
23064 __input: &[u8],
23065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23066 let avail_len = __input.len();
23067 let mut payload_buf = [0; Self::ENCODED_LEN];
23068 let mut buf = if avail_len < Self::ENCODED_LEN {
23069 payload_buf[0..avail_len].copy_from_slice(__input);
23070 Bytes::new(&payload_buf)
23071 } else {
23072 Bytes::new(__input)
23073 };
23074 let mut __struct = Self::default();
23075 __struct.param_count = buf.get_u16_le();
23076 __struct.param_index = buf.get_u16_le();
23077 for v in &mut __struct.param_id {
23078 let val = buf.get_u8();
23079 *v = val;
23080 }
23081 for v in &mut __struct.param_value {
23082 let val = buf.get_u8();
23083 *v = val;
23084 }
23085 let tmp = buf.get_u8();
23086 __struct.param_type =
23087 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23088 enum_type: "MavParamExtType",
23089 value: tmp as u32,
23090 })?;
23091 Ok(__struct)
23092 }
23093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23094 let mut __tmp = BytesMut::new(bytes);
23095 #[allow(clippy::absurd_extreme_comparisons)]
23096 #[allow(unused_comparisons)]
23097 if __tmp.remaining() < Self::ENCODED_LEN {
23098 panic!(
23099 "buffer is too small (need {} bytes, but got {})",
23100 Self::ENCODED_LEN,
23101 __tmp.remaining(),
23102 )
23103 }
23104 __tmp.put_u16_le(self.param_count);
23105 __tmp.put_u16_le(self.param_index);
23106 for val in &self.param_id {
23107 __tmp.put_u8(*val);
23108 }
23109 for val in &self.param_value {
23110 __tmp.put_u8(*val);
23111 }
23112 __tmp.put_u8(self.param_type as u8);
23113 if matches!(version, MavlinkVersion::V2) {
23114 let len = __tmp.len();
23115 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23116 } else {
23117 __tmp.len()
23118 }
23119 }
23120}
23121#[doc = "id: 50"]
23122#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23123#[derive(Debug, Clone, PartialEq)]
23124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23126pub struct PARAM_MAP_RC_DATA {
23127 #[doc = "Initial parameter value"]
23128 pub param_value0: f32,
23129 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23130 pub scale: f32,
23131 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23132 pub param_value_min: f32,
23133 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23134 pub param_value_max: f32,
23135 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23136 pub param_index: i16,
23137 #[doc = "System ID"]
23138 pub target_system: u8,
23139 #[doc = "Component ID"]
23140 pub target_component: u8,
23141 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23142 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23143 pub param_id: [u8; 16],
23144 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23145 pub parameter_rc_channel_index: u8,
23146}
23147impl PARAM_MAP_RC_DATA {
23148 pub const ENCODED_LEN: usize = 37usize;
23149 pub const DEFAULT: Self = Self {
23150 param_value0: 0.0_f32,
23151 scale: 0.0_f32,
23152 param_value_min: 0.0_f32,
23153 param_value_max: 0.0_f32,
23154 param_index: 0_i16,
23155 target_system: 0_u8,
23156 target_component: 0_u8,
23157 param_id: [0_u8; 16usize],
23158 parameter_rc_channel_index: 0_u8,
23159 };
23160 #[cfg(feature = "arbitrary")]
23161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23162 use arbitrary::{Arbitrary, Unstructured};
23163 let mut buf = [0u8; 1024];
23164 rng.fill_bytes(&mut buf);
23165 let mut unstructured = Unstructured::new(&buf);
23166 Self::arbitrary(&mut unstructured).unwrap_or_default()
23167 }
23168}
23169impl Default for PARAM_MAP_RC_DATA {
23170 fn default() -> Self {
23171 Self::DEFAULT.clone()
23172 }
23173}
23174impl MessageData for PARAM_MAP_RC_DATA {
23175 type Message = MavMessage;
23176 const ID: u32 = 50u32;
23177 const NAME: &'static str = "PARAM_MAP_RC";
23178 const EXTRA_CRC: u8 = 78u8;
23179 const ENCODED_LEN: usize = 37usize;
23180 fn deser(
23181 _version: MavlinkVersion,
23182 __input: &[u8],
23183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23184 let avail_len = __input.len();
23185 let mut payload_buf = [0; Self::ENCODED_LEN];
23186 let mut buf = if avail_len < Self::ENCODED_LEN {
23187 payload_buf[0..avail_len].copy_from_slice(__input);
23188 Bytes::new(&payload_buf)
23189 } else {
23190 Bytes::new(__input)
23191 };
23192 let mut __struct = Self::default();
23193 __struct.param_value0 = buf.get_f32_le();
23194 __struct.scale = buf.get_f32_le();
23195 __struct.param_value_min = buf.get_f32_le();
23196 __struct.param_value_max = buf.get_f32_le();
23197 __struct.param_index = buf.get_i16_le();
23198 __struct.target_system = buf.get_u8();
23199 __struct.target_component = buf.get_u8();
23200 for v in &mut __struct.param_id {
23201 let val = buf.get_u8();
23202 *v = val;
23203 }
23204 __struct.parameter_rc_channel_index = buf.get_u8();
23205 Ok(__struct)
23206 }
23207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23208 let mut __tmp = BytesMut::new(bytes);
23209 #[allow(clippy::absurd_extreme_comparisons)]
23210 #[allow(unused_comparisons)]
23211 if __tmp.remaining() < Self::ENCODED_LEN {
23212 panic!(
23213 "buffer is too small (need {} bytes, but got {})",
23214 Self::ENCODED_LEN,
23215 __tmp.remaining(),
23216 )
23217 }
23218 __tmp.put_f32_le(self.param_value0);
23219 __tmp.put_f32_le(self.scale);
23220 __tmp.put_f32_le(self.param_value_min);
23221 __tmp.put_f32_le(self.param_value_max);
23222 __tmp.put_i16_le(self.param_index);
23223 __tmp.put_u8(self.target_system);
23224 __tmp.put_u8(self.target_component);
23225 for val in &self.param_id {
23226 __tmp.put_u8(*val);
23227 }
23228 __tmp.put_u8(self.parameter_rc_channel_index);
23229 if matches!(version, MavlinkVersion::V2) {
23230 let len = __tmp.len();
23231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23232 } else {
23233 __tmp.len()
23234 }
23235 }
23236}
23237#[doc = "id: 21"]
23238#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23239#[derive(Debug, Clone, PartialEq)]
23240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23242pub struct PARAM_REQUEST_LIST_DATA {
23243 #[doc = "System ID"]
23244 pub target_system: u8,
23245 #[doc = "Component ID"]
23246 pub target_component: u8,
23247}
23248impl PARAM_REQUEST_LIST_DATA {
23249 pub const ENCODED_LEN: usize = 2usize;
23250 pub const DEFAULT: Self = Self {
23251 target_system: 0_u8,
23252 target_component: 0_u8,
23253 };
23254 #[cfg(feature = "arbitrary")]
23255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23256 use arbitrary::{Arbitrary, Unstructured};
23257 let mut buf = [0u8; 1024];
23258 rng.fill_bytes(&mut buf);
23259 let mut unstructured = Unstructured::new(&buf);
23260 Self::arbitrary(&mut unstructured).unwrap_or_default()
23261 }
23262}
23263impl Default for PARAM_REQUEST_LIST_DATA {
23264 fn default() -> Self {
23265 Self::DEFAULT.clone()
23266 }
23267}
23268impl MessageData for PARAM_REQUEST_LIST_DATA {
23269 type Message = MavMessage;
23270 const ID: u32 = 21u32;
23271 const NAME: &'static str = "PARAM_REQUEST_LIST";
23272 const EXTRA_CRC: u8 = 159u8;
23273 const ENCODED_LEN: usize = 2usize;
23274 fn deser(
23275 _version: MavlinkVersion,
23276 __input: &[u8],
23277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23278 let avail_len = __input.len();
23279 let mut payload_buf = [0; Self::ENCODED_LEN];
23280 let mut buf = if avail_len < Self::ENCODED_LEN {
23281 payload_buf[0..avail_len].copy_from_slice(__input);
23282 Bytes::new(&payload_buf)
23283 } else {
23284 Bytes::new(__input)
23285 };
23286 let mut __struct = Self::default();
23287 __struct.target_system = buf.get_u8();
23288 __struct.target_component = buf.get_u8();
23289 Ok(__struct)
23290 }
23291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23292 let mut __tmp = BytesMut::new(bytes);
23293 #[allow(clippy::absurd_extreme_comparisons)]
23294 #[allow(unused_comparisons)]
23295 if __tmp.remaining() < Self::ENCODED_LEN {
23296 panic!(
23297 "buffer is too small (need {} bytes, but got {})",
23298 Self::ENCODED_LEN,
23299 __tmp.remaining(),
23300 )
23301 }
23302 __tmp.put_u8(self.target_system);
23303 __tmp.put_u8(self.target_component);
23304 if matches!(version, MavlinkVersion::V2) {
23305 let len = __tmp.len();
23306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23307 } else {
23308 __tmp.len()
23309 }
23310 }
23311}
23312#[doc = "id: 20"]
23313#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23314#[derive(Debug, Clone, PartialEq)]
23315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23317pub struct PARAM_REQUEST_READ_DATA {
23318 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23319 pub param_index: i16,
23320 #[doc = "System ID"]
23321 pub target_system: u8,
23322 #[doc = "Component ID"]
23323 pub target_component: u8,
23324 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23325 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23326 pub param_id: [u8; 16],
23327}
23328impl PARAM_REQUEST_READ_DATA {
23329 pub const ENCODED_LEN: usize = 20usize;
23330 pub const DEFAULT: Self = Self {
23331 param_index: 0_i16,
23332 target_system: 0_u8,
23333 target_component: 0_u8,
23334 param_id: [0_u8; 16usize],
23335 };
23336 #[cfg(feature = "arbitrary")]
23337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23338 use arbitrary::{Arbitrary, Unstructured};
23339 let mut buf = [0u8; 1024];
23340 rng.fill_bytes(&mut buf);
23341 let mut unstructured = Unstructured::new(&buf);
23342 Self::arbitrary(&mut unstructured).unwrap_or_default()
23343 }
23344}
23345impl Default for PARAM_REQUEST_READ_DATA {
23346 fn default() -> Self {
23347 Self::DEFAULT.clone()
23348 }
23349}
23350impl MessageData for PARAM_REQUEST_READ_DATA {
23351 type Message = MavMessage;
23352 const ID: u32 = 20u32;
23353 const NAME: &'static str = "PARAM_REQUEST_READ";
23354 const EXTRA_CRC: u8 = 214u8;
23355 const ENCODED_LEN: usize = 20usize;
23356 fn deser(
23357 _version: MavlinkVersion,
23358 __input: &[u8],
23359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23360 let avail_len = __input.len();
23361 let mut payload_buf = [0; Self::ENCODED_LEN];
23362 let mut buf = if avail_len < Self::ENCODED_LEN {
23363 payload_buf[0..avail_len].copy_from_slice(__input);
23364 Bytes::new(&payload_buf)
23365 } else {
23366 Bytes::new(__input)
23367 };
23368 let mut __struct = Self::default();
23369 __struct.param_index = buf.get_i16_le();
23370 __struct.target_system = buf.get_u8();
23371 __struct.target_component = buf.get_u8();
23372 for v in &mut __struct.param_id {
23373 let val = buf.get_u8();
23374 *v = val;
23375 }
23376 Ok(__struct)
23377 }
23378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23379 let mut __tmp = BytesMut::new(bytes);
23380 #[allow(clippy::absurd_extreme_comparisons)]
23381 #[allow(unused_comparisons)]
23382 if __tmp.remaining() < Self::ENCODED_LEN {
23383 panic!(
23384 "buffer is too small (need {} bytes, but got {})",
23385 Self::ENCODED_LEN,
23386 __tmp.remaining(),
23387 )
23388 }
23389 __tmp.put_i16_le(self.param_index);
23390 __tmp.put_u8(self.target_system);
23391 __tmp.put_u8(self.target_component);
23392 for val in &self.param_id {
23393 __tmp.put_u8(*val);
23394 }
23395 if matches!(version, MavlinkVersion::V2) {
23396 let len = __tmp.len();
23397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23398 } else {
23399 __tmp.len()
23400 }
23401 }
23402}
23403#[doc = "id: 23"]
23404#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23405#[derive(Debug, Clone, PartialEq)]
23406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23408pub struct PARAM_SET_DATA {
23409 #[doc = "Onboard parameter value"]
23410 pub param_value: f32,
23411 #[doc = "System ID"]
23412 pub target_system: u8,
23413 #[doc = "Component ID"]
23414 pub target_component: u8,
23415 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23416 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23417 pub param_id: [u8; 16],
23418 #[doc = "Onboard parameter type."]
23419 pub param_type: MavParamType,
23420}
23421impl PARAM_SET_DATA {
23422 pub const ENCODED_LEN: usize = 23usize;
23423 pub const DEFAULT: Self = Self {
23424 param_value: 0.0_f32,
23425 target_system: 0_u8,
23426 target_component: 0_u8,
23427 param_id: [0_u8; 16usize],
23428 param_type: MavParamType::DEFAULT,
23429 };
23430 #[cfg(feature = "arbitrary")]
23431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23432 use arbitrary::{Arbitrary, Unstructured};
23433 let mut buf = [0u8; 1024];
23434 rng.fill_bytes(&mut buf);
23435 let mut unstructured = Unstructured::new(&buf);
23436 Self::arbitrary(&mut unstructured).unwrap_or_default()
23437 }
23438}
23439impl Default for PARAM_SET_DATA {
23440 fn default() -> Self {
23441 Self::DEFAULT.clone()
23442 }
23443}
23444impl MessageData for PARAM_SET_DATA {
23445 type Message = MavMessage;
23446 const ID: u32 = 23u32;
23447 const NAME: &'static str = "PARAM_SET";
23448 const EXTRA_CRC: u8 = 168u8;
23449 const ENCODED_LEN: usize = 23usize;
23450 fn deser(
23451 _version: MavlinkVersion,
23452 __input: &[u8],
23453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23454 let avail_len = __input.len();
23455 let mut payload_buf = [0; Self::ENCODED_LEN];
23456 let mut buf = if avail_len < Self::ENCODED_LEN {
23457 payload_buf[0..avail_len].copy_from_slice(__input);
23458 Bytes::new(&payload_buf)
23459 } else {
23460 Bytes::new(__input)
23461 };
23462 let mut __struct = Self::default();
23463 __struct.param_value = buf.get_f32_le();
23464 __struct.target_system = buf.get_u8();
23465 __struct.target_component = buf.get_u8();
23466 for v in &mut __struct.param_id {
23467 let val = buf.get_u8();
23468 *v = val;
23469 }
23470 let tmp = buf.get_u8();
23471 __struct.param_type =
23472 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23473 enum_type: "MavParamType",
23474 value: tmp as u32,
23475 })?;
23476 Ok(__struct)
23477 }
23478 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23479 let mut __tmp = BytesMut::new(bytes);
23480 #[allow(clippy::absurd_extreme_comparisons)]
23481 #[allow(unused_comparisons)]
23482 if __tmp.remaining() < Self::ENCODED_LEN {
23483 panic!(
23484 "buffer is too small (need {} bytes, but got {})",
23485 Self::ENCODED_LEN,
23486 __tmp.remaining(),
23487 )
23488 }
23489 __tmp.put_f32_le(self.param_value);
23490 __tmp.put_u8(self.target_system);
23491 __tmp.put_u8(self.target_component);
23492 for val in &self.param_id {
23493 __tmp.put_u8(*val);
23494 }
23495 __tmp.put_u8(self.param_type as u8);
23496 if matches!(version, MavlinkVersion::V2) {
23497 let len = __tmp.len();
23498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23499 } else {
23500 __tmp.len()
23501 }
23502 }
23503}
23504#[doc = "id: 22"]
23505#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23506#[derive(Debug, Clone, PartialEq)]
23507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23509pub struct PARAM_VALUE_DATA {
23510 #[doc = "Onboard parameter value"]
23511 pub param_value: f32,
23512 #[doc = "Total number of onboard parameters"]
23513 pub param_count: u16,
23514 #[doc = "Index of this onboard parameter"]
23515 pub param_index: u16,
23516 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23517 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23518 pub param_id: [u8; 16],
23519 #[doc = "Onboard parameter type."]
23520 pub param_type: MavParamType,
23521}
23522impl PARAM_VALUE_DATA {
23523 pub const ENCODED_LEN: usize = 25usize;
23524 pub const DEFAULT: Self = Self {
23525 param_value: 0.0_f32,
23526 param_count: 0_u16,
23527 param_index: 0_u16,
23528 param_id: [0_u8; 16usize],
23529 param_type: MavParamType::DEFAULT,
23530 };
23531 #[cfg(feature = "arbitrary")]
23532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23533 use arbitrary::{Arbitrary, Unstructured};
23534 let mut buf = [0u8; 1024];
23535 rng.fill_bytes(&mut buf);
23536 let mut unstructured = Unstructured::new(&buf);
23537 Self::arbitrary(&mut unstructured).unwrap_or_default()
23538 }
23539}
23540impl Default for PARAM_VALUE_DATA {
23541 fn default() -> Self {
23542 Self::DEFAULT.clone()
23543 }
23544}
23545impl MessageData for PARAM_VALUE_DATA {
23546 type Message = MavMessage;
23547 const ID: u32 = 22u32;
23548 const NAME: &'static str = "PARAM_VALUE";
23549 const EXTRA_CRC: u8 = 220u8;
23550 const ENCODED_LEN: usize = 25usize;
23551 fn deser(
23552 _version: MavlinkVersion,
23553 __input: &[u8],
23554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23555 let avail_len = __input.len();
23556 let mut payload_buf = [0; Self::ENCODED_LEN];
23557 let mut buf = if avail_len < Self::ENCODED_LEN {
23558 payload_buf[0..avail_len].copy_from_slice(__input);
23559 Bytes::new(&payload_buf)
23560 } else {
23561 Bytes::new(__input)
23562 };
23563 let mut __struct = Self::default();
23564 __struct.param_value = buf.get_f32_le();
23565 __struct.param_count = buf.get_u16_le();
23566 __struct.param_index = buf.get_u16_le();
23567 for v in &mut __struct.param_id {
23568 let val = buf.get_u8();
23569 *v = val;
23570 }
23571 let tmp = buf.get_u8();
23572 __struct.param_type =
23573 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23574 enum_type: "MavParamType",
23575 value: tmp as u32,
23576 })?;
23577 Ok(__struct)
23578 }
23579 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23580 let mut __tmp = BytesMut::new(bytes);
23581 #[allow(clippy::absurd_extreme_comparisons)]
23582 #[allow(unused_comparisons)]
23583 if __tmp.remaining() < Self::ENCODED_LEN {
23584 panic!(
23585 "buffer is too small (need {} bytes, but got {})",
23586 Self::ENCODED_LEN,
23587 __tmp.remaining(),
23588 )
23589 }
23590 __tmp.put_f32_le(self.param_value);
23591 __tmp.put_u16_le(self.param_count);
23592 __tmp.put_u16_le(self.param_index);
23593 for val in &self.param_id {
23594 __tmp.put_u8(*val);
23595 }
23596 __tmp.put_u8(self.param_type as u8);
23597 if matches!(version, MavlinkVersion::V2) {
23598 let len = __tmp.len();
23599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23600 } else {
23601 __tmp.len()
23602 }
23603 }
23604}
23605#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23606#[doc = "id: 4"]
23607#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23608#[derive(Debug, Clone, PartialEq)]
23609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23611pub struct PING_DATA {
23612 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23613 pub time_usec: u64,
23614 #[doc = "PING sequence"]
23615 pub seq: u32,
23616 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23617 pub target_system: u8,
23618 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23619 pub target_component: u8,
23620}
23621impl PING_DATA {
23622 pub const ENCODED_LEN: usize = 14usize;
23623 pub const DEFAULT: Self = Self {
23624 time_usec: 0_u64,
23625 seq: 0_u32,
23626 target_system: 0_u8,
23627 target_component: 0_u8,
23628 };
23629 #[cfg(feature = "arbitrary")]
23630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23631 use arbitrary::{Arbitrary, Unstructured};
23632 let mut buf = [0u8; 1024];
23633 rng.fill_bytes(&mut buf);
23634 let mut unstructured = Unstructured::new(&buf);
23635 Self::arbitrary(&mut unstructured).unwrap_or_default()
23636 }
23637}
23638impl Default for PING_DATA {
23639 fn default() -> Self {
23640 Self::DEFAULT.clone()
23641 }
23642}
23643impl MessageData for PING_DATA {
23644 type Message = MavMessage;
23645 const ID: u32 = 4u32;
23646 const NAME: &'static str = "PING";
23647 const EXTRA_CRC: u8 = 237u8;
23648 const ENCODED_LEN: usize = 14usize;
23649 fn deser(
23650 _version: MavlinkVersion,
23651 __input: &[u8],
23652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23653 let avail_len = __input.len();
23654 let mut payload_buf = [0; Self::ENCODED_LEN];
23655 let mut buf = if avail_len < Self::ENCODED_LEN {
23656 payload_buf[0..avail_len].copy_from_slice(__input);
23657 Bytes::new(&payload_buf)
23658 } else {
23659 Bytes::new(__input)
23660 };
23661 let mut __struct = Self::default();
23662 __struct.time_usec = buf.get_u64_le();
23663 __struct.seq = buf.get_u32_le();
23664 __struct.target_system = buf.get_u8();
23665 __struct.target_component = buf.get_u8();
23666 Ok(__struct)
23667 }
23668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23669 let mut __tmp = BytesMut::new(bytes);
23670 #[allow(clippy::absurd_extreme_comparisons)]
23671 #[allow(unused_comparisons)]
23672 if __tmp.remaining() < Self::ENCODED_LEN {
23673 panic!(
23674 "buffer is too small (need {} bytes, but got {})",
23675 Self::ENCODED_LEN,
23676 __tmp.remaining(),
23677 )
23678 }
23679 __tmp.put_u64_le(self.time_usec);
23680 __tmp.put_u32_le(self.seq);
23681 __tmp.put_u8(self.target_system);
23682 __tmp.put_u8(self.target_component);
23683 if matches!(version, MavlinkVersion::V2) {
23684 let len = __tmp.len();
23685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23686 } else {
23687 __tmp.len()
23688 }
23689 }
23690}
23691#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23692#[doc = "id: 258"]
23693#[doc = "Control vehicle tone generation (buzzer)."]
23694#[derive(Debug, Clone, PartialEq)]
23695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23697pub struct PLAY_TUNE_DATA {
23698 #[doc = "System ID"]
23699 pub target_system: u8,
23700 #[doc = "Component ID"]
23701 pub target_component: u8,
23702 #[doc = "tune in board specific format"]
23703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23704 pub tune: [u8; 30],
23705 #[doc = "tune extension (appended to tune)"]
23706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23708 pub tune2: [u8; 200],
23709}
23710impl PLAY_TUNE_DATA {
23711 pub const ENCODED_LEN: usize = 232usize;
23712 pub const DEFAULT: Self = Self {
23713 target_system: 0_u8,
23714 target_component: 0_u8,
23715 tune: [0_u8; 30usize],
23716 tune2: [0_u8; 200usize],
23717 };
23718 #[cfg(feature = "arbitrary")]
23719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23720 use arbitrary::{Arbitrary, Unstructured};
23721 let mut buf = [0u8; 1024];
23722 rng.fill_bytes(&mut buf);
23723 let mut unstructured = Unstructured::new(&buf);
23724 Self::arbitrary(&mut unstructured).unwrap_or_default()
23725 }
23726}
23727impl Default for PLAY_TUNE_DATA {
23728 fn default() -> Self {
23729 Self::DEFAULT.clone()
23730 }
23731}
23732impl MessageData for PLAY_TUNE_DATA {
23733 type Message = MavMessage;
23734 const ID: u32 = 258u32;
23735 const NAME: &'static str = "PLAY_TUNE";
23736 const EXTRA_CRC: u8 = 187u8;
23737 const ENCODED_LEN: usize = 232usize;
23738 fn deser(
23739 _version: MavlinkVersion,
23740 __input: &[u8],
23741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23742 let avail_len = __input.len();
23743 let mut payload_buf = [0; Self::ENCODED_LEN];
23744 let mut buf = if avail_len < Self::ENCODED_LEN {
23745 payload_buf[0..avail_len].copy_from_slice(__input);
23746 Bytes::new(&payload_buf)
23747 } else {
23748 Bytes::new(__input)
23749 };
23750 let mut __struct = Self::default();
23751 __struct.target_system = buf.get_u8();
23752 __struct.target_component = buf.get_u8();
23753 for v in &mut __struct.tune {
23754 let val = buf.get_u8();
23755 *v = val;
23756 }
23757 for v in &mut __struct.tune2 {
23758 let val = buf.get_u8();
23759 *v = val;
23760 }
23761 Ok(__struct)
23762 }
23763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23764 let mut __tmp = BytesMut::new(bytes);
23765 #[allow(clippy::absurd_extreme_comparisons)]
23766 #[allow(unused_comparisons)]
23767 if __tmp.remaining() < Self::ENCODED_LEN {
23768 panic!(
23769 "buffer is too small (need {} bytes, but got {})",
23770 Self::ENCODED_LEN,
23771 __tmp.remaining(),
23772 )
23773 }
23774 __tmp.put_u8(self.target_system);
23775 __tmp.put_u8(self.target_component);
23776 for val in &self.tune {
23777 __tmp.put_u8(*val);
23778 }
23779 for val in &self.tune2 {
23780 __tmp.put_u8(*val);
23781 }
23782 if matches!(version, MavlinkVersion::V2) {
23783 let len = __tmp.len();
23784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23785 } else {
23786 __tmp.len()
23787 }
23788 }
23789}
23790#[doc = "id: 400"]
23791#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23792#[derive(Debug, Clone, PartialEq)]
23793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23795pub struct PLAY_TUNE_V2_DATA {
23796 #[doc = "Tune format"]
23797 pub format: TuneFormat,
23798 #[doc = "System ID"]
23799 pub target_system: u8,
23800 #[doc = "Component ID"]
23801 pub target_component: u8,
23802 #[doc = "Tune definition as a NULL-terminated string."]
23803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23804 pub tune: [u8; 248],
23805}
23806impl PLAY_TUNE_V2_DATA {
23807 pub const ENCODED_LEN: usize = 254usize;
23808 pub const DEFAULT: Self = Self {
23809 format: TuneFormat::DEFAULT,
23810 target_system: 0_u8,
23811 target_component: 0_u8,
23812 tune: [0_u8; 248usize],
23813 };
23814 #[cfg(feature = "arbitrary")]
23815 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23816 use arbitrary::{Arbitrary, Unstructured};
23817 let mut buf = [0u8; 1024];
23818 rng.fill_bytes(&mut buf);
23819 let mut unstructured = Unstructured::new(&buf);
23820 Self::arbitrary(&mut unstructured).unwrap_or_default()
23821 }
23822}
23823impl Default for PLAY_TUNE_V2_DATA {
23824 fn default() -> Self {
23825 Self::DEFAULT.clone()
23826 }
23827}
23828impl MessageData for PLAY_TUNE_V2_DATA {
23829 type Message = MavMessage;
23830 const ID: u32 = 400u32;
23831 const NAME: &'static str = "PLAY_TUNE_V2";
23832 const EXTRA_CRC: u8 = 110u8;
23833 const ENCODED_LEN: usize = 254usize;
23834 fn deser(
23835 _version: MavlinkVersion,
23836 __input: &[u8],
23837 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23838 let avail_len = __input.len();
23839 let mut payload_buf = [0; Self::ENCODED_LEN];
23840 let mut buf = if avail_len < Self::ENCODED_LEN {
23841 payload_buf[0..avail_len].copy_from_slice(__input);
23842 Bytes::new(&payload_buf)
23843 } else {
23844 Bytes::new(__input)
23845 };
23846 let mut __struct = Self::default();
23847 let tmp = buf.get_u32_le();
23848 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23849 ::mavlink_core::error::ParserError::InvalidEnum {
23850 enum_type: "TuneFormat",
23851 value: tmp as u32,
23852 },
23853 )?;
23854 __struct.target_system = buf.get_u8();
23855 __struct.target_component = buf.get_u8();
23856 for v in &mut __struct.tune {
23857 let val = buf.get_u8();
23858 *v = val;
23859 }
23860 Ok(__struct)
23861 }
23862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23863 let mut __tmp = BytesMut::new(bytes);
23864 #[allow(clippy::absurd_extreme_comparisons)]
23865 #[allow(unused_comparisons)]
23866 if __tmp.remaining() < Self::ENCODED_LEN {
23867 panic!(
23868 "buffer is too small (need {} bytes, but got {})",
23869 Self::ENCODED_LEN,
23870 __tmp.remaining(),
23871 )
23872 }
23873 __tmp.put_u32_le(self.format as u32);
23874 __tmp.put_u8(self.target_system);
23875 __tmp.put_u8(self.target_component);
23876 for val in &self.tune {
23877 __tmp.put_u8(*val);
23878 }
23879 if matches!(version, MavlinkVersion::V2) {
23880 let len = __tmp.len();
23881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23882 } else {
23883 __tmp.len()
23884 }
23885 }
23886}
23887#[doc = "id: 87"]
23888#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23889#[derive(Debug, Clone, PartialEq)]
23890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23892pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23893 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23894 pub time_boot_ms: u32,
23895 #[doc = "Latitude in WGS84 frame"]
23896 pub lat_int: i32,
23897 #[doc = "Longitude in WGS84 frame"]
23898 pub lon_int: i32,
23899 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23900 pub alt: f32,
23901 #[doc = "X velocity in NED frame"]
23902 pub vx: f32,
23903 #[doc = "Y velocity in NED frame"]
23904 pub vy: f32,
23905 #[doc = "Z velocity in NED frame"]
23906 pub vz: f32,
23907 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23908 pub afx: f32,
23909 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23910 pub afy: f32,
23911 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23912 pub afz: f32,
23913 #[doc = "yaw setpoint"]
23914 pub yaw: f32,
23915 #[doc = "yaw rate setpoint"]
23916 pub yaw_rate: f32,
23917 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23918 pub type_mask: PositionTargetTypemask,
23919 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23920 pub coordinate_frame: MavFrame,
23921}
23922impl POSITION_TARGET_GLOBAL_INT_DATA {
23923 pub const ENCODED_LEN: usize = 51usize;
23924 pub const DEFAULT: Self = Self {
23925 time_boot_ms: 0_u32,
23926 lat_int: 0_i32,
23927 lon_int: 0_i32,
23928 alt: 0.0_f32,
23929 vx: 0.0_f32,
23930 vy: 0.0_f32,
23931 vz: 0.0_f32,
23932 afx: 0.0_f32,
23933 afy: 0.0_f32,
23934 afz: 0.0_f32,
23935 yaw: 0.0_f32,
23936 yaw_rate: 0.0_f32,
23937 type_mask: PositionTargetTypemask::DEFAULT,
23938 coordinate_frame: MavFrame::DEFAULT,
23939 };
23940 #[cfg(feature = "arbitrary")]
23941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23942 use arbitrary::{Arbitrary, Unstructured};
23943 let mut buf = [0u8; 1024];
23944 rng.fill_bytes(&mut buf);
23945 let mut unstructured = Unstructured::new(&buf);
23946 Self::arbitrary(&mut unstructured).unwrap_or_default()
23947 }
23948}
23949impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23950 fn default() -> Self {
23951 Self::DEFAULT.clone()
23952 }
23953}
23954impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23955 type Message = MavMessage;
23956 const ID: u32 = 87u32;
23957 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23958 const EXTRA_CRC: u8 = 150u8;
23959 const ENCODED_LEN: usize = 51usize;
23960 fn deser(
23961 _version: MavlinkVersion,
23962 __input: &[u8],
23963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23964 let avail_len = __input.len();
23965 let mut payload_buf = [0; Self::ENCODED_LEN];
23966 let mut buf = if avail_len < Self::ENCODED_LEN {
23967 payload_buf[0..avail_len].copy_from_slice(__input);
23968 Bytes::new(&payload_buf)
23969 } else {
23970 Bytes::new(__input)
23971 };
23972 let mut __struct = Self::default();
23973 __struct.time_boot_ms = buf.get_u32_le();
23974 __struct.lat_int = buf.get_i32_le();
23975 __struct.lon_int = buf.get_i32_le();
23976 __struct.alt = buf.get_f32_le();
23977 __struct.vx = buf.get_f32_le();
23978 __struct.vy = buf.get_f32_le();
23979 __struct.vz = buf.get_f32_le();
23980 __struct.afx = buf.get_f32_le();
23981 __struct.afy = buf.get_f32_le();
23982 __struct.afz = buf.get_f32_le();
23983 __struct.yaw = buf.get_f32_le();
23984 __struct.yaw_rate = buf.get_f32_le();
23985 let tmp = buf.get_u16_le();
23986 __struct.type_mask = PositionTargetTypemask::from_bits(
23987 tmp & PositionTargetTypemask::all().bits(),
23988 )
23989 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23990 flag_type: "PositionTargetTypemask",
23991 value: tmp as u32,
23992 })?;
23993 let tmp = buf.get_u8();
23994 __struct.coordinate_frame =
23995 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23996 enum_type: "MavFrame",
23997 value: tmp as u32,
23998 })?;
23999 Ok(__struct)
24000 }
24001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24002 let mut __tmp = BytesMut::new(bytes);
24003 #[allow(clippy::absurd_extreme_comparisons)]
24004 #[allow(unused_comparisons)]
24005 if __tmp.remaining() < Self::ENCODED_LEN {
24006 panic!(
24007 "buffer is too small (need {} bytes, but got {})",
24008 Self::ENCODED_LEN,
24009 __tmp.remaining(),
24010 )
24011 }
24012 __tmp.put_u32_le(self.time_boot_ms);
24013 __tmp.put_i32_le(self.lat_int);
24014 __tmp.put_i32_le(self.lon_int);
24015 __tmp.put_f32_le(self.alt);
24016 __tmp.put_f32_le(self.vx);
24017 __tmp.put_f32_le(self.vy);
24018 __tmp.put_f32_le(self.vz);
24019 __tmp.put_f32_le(self.afx);
24020 __tmp.put_f32_le(self.afy);
24021 __tmp.put_f32_le(self.afz);
24022 __tmp.put_f32_le(self.yaw);
24023 __tmp.put_f32_le(self.yaw_rate);
24024 __tmp.put_u16_le(self.type_mask.bits());
24025 __tmp.put_u8(self.coordinate_frame as u8);
24026 if matches!(version, MavlinkVersion::V2) {
24027 let len = __tmp.len();
24028 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24029 } else {
24030 __tmp.len()
24031 }
24032 }
24033}
24034#[doc = "id: 85"]
24035#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24036#[derive(Debug, Clone, PartialEq)]
24037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24039pub struct POSITION_TARGET_LOCAL_NED_DATA {
24040 #[doc = "Timestamp (time since system boot)."]
24041 pub time_boot_ms: u32,
24042 #[doc = "X Position in NED frame"]
24043 pub x: f32,
24044 #[doc = "Y Position in NED frame"]
24045 pub y: f32,
24046 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24047 pub z: f32,
24048 #[doc = "X velocity in NED frame"]
24049 pub vx: f32,
24050 #[doc = "Y velocity in NED frame"]
24051 pub vy: f32,
24052 #[doc = "Z velocity in NED frame"]
24053 pub vz: f32,
24054 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24055 pub afx: f32,
24056 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24057 pub afy: f32,
24058 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24059 pub afz: f32,
24060 #[doc = "yaw setpoint"]
24061 pub yaw: f32,
24062 #[doc = "yaw rate setpoint"]
24063 pub yaw_rate: f32,
24064 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24065 pub type_mask: PositionTargetTypemask,
24066 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24067 pub coordinate_frame: MavFrame,
24068}
24069impl POSITION_TARGET_LOCAL_NED_DATA {
24070 pub const ENCODED_LEN: usize = 51usize;
24071 pub const DEFAULT: Self = Self {
24072 time_boot_ms: 0_u32,
24073 x: 0.0_f32,
24074 y: 0.0_f32,
24075 z: 0.0_f32,
24076 vx: 0.0_f32,
24077 vy: 0.0_f32,
24078 vz: 0.0_f32,
24079 afx: 0.0_f32,
24080 afy: 0.0_f32,
24081 afz: 0.0_f32,
24082 yaw: 0.0_f32,
24083 yaw_rate: 0.0_f32,
24084 type_mask: PositionTargetTypemask::DEFAULT,
24085 coordinate_frame: MavFrame::DEFAULT,
24086 };
24087 #[cfg(feature = "arbitrary")]
24088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24089 use arbitrary::{Arbitrary, Unstructured};
24090 let mut buf = [0u8; 1024];
24091 rng.fill_bytes(&mut buf);
24092 let mut unstructured = Unstructured::new(&buf);
24093 Self::arbitrary(&mut unstructured).unwrap_or_default()
24094 }
24095}
24096impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24097 fn default() -> Self {
24098 Self::DEFAULT.clone()
24099 }
24100}
24101impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24102 type Message = MavMessage;
24103 const ID: u32 = 85u32;
24104 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24105 const EXTRA_CRC: u8 = 140u8;
24106 const ENCODED_LEN: usize = 51usize;
24107 fn deser(
24108 _version: MavlinkVersion,
24109 __input: &[u8],
24110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24111 let avail_len = __input.len();
24112 let mut payload_buf = [0; Self::ENCODED_LEN];
24113 let mut buf = if avail_len < Self::ENCODED_LEN {
24114 payload_buf[0..avail_len].copy_from_slice(__input);
24115 Bytes::new(&payload_buf)
24116 } else {
24117 Bytes::new(__input)
24118 };
24119 let mut __struct = Self::default();
24120 __struct.time_boot_ms = buf.get_u32_le();
24121 __struct.x = buf.get_f32_le();
24122 __struct.y = buf.get_f32_le();
24123 __struct.z = buf.get_f32_le();
24124 __struct.vx = buf.get_f32_le();
24125 __struct.vy = buf.get_f32_le();
24126 __struct.vz = buf.get_f32_le();
24127 __struct.afx = buf.get_f32_le();
24128 __struct.afy = buf.get_f32_le();
24129 __struct.afz = buf.get_f32_le();
24130 __struct.yaw = buf.get_f32_le();
24131 __struct.yaw_rate = buf.get_f32_le();
24132 let tmp = buf.get_u16_le();
24133 __struct.type_mask = PositionTargetTypemask::from_bits(
24134 tmp & PositionTargetTypemask::all().bits(),
24135 )
24136 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24137 flag_type: "PositionTargetTypemask",
24138 value: tmp as u32,
24139 })?;
24140 let tmp = buf.get_u8();
24141 __struct.coordinate_frame =
24142 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24143 enum_type: "MavFrame",
24144 value: tmp as u32,
24145 })?;
24146 Ok(__struct)
24147 }
24148 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24149 let mut __tmp = BytesMut::new(bytes);
24150 #[allow(clippy::absurd_extreme_comparisons)]
24151 #[allow(unused_comparisons)]
24152 if __tmp.remaining() < Self::ENCODED_LEN {
24153 panic!(
24154 "buffer is too small (need {} bytes, but got {})",
24155 Self::ENCODED_LEN,
24156 __tmp.remaining(),
24157 )
24158 }
24159 __tmp.put_u32_le(self.time_boot_ms);
24160 __tmp.put_f32_le(self.x);
24161 __tmp.put_f32_le(self.y);
24162 __tmp.put_f32_le(self.z);
24163 __tmp.put_f32_le(self.vx);
24164 __tmp.put_f32_le(self.vy);
24165 __tmp.put_f32_le(self.vz);
24166 __tmp.put_f32_le(self.afx);
24167 __tmp.put_f32_le(self.afy);
24168 __tmp.put_f32_le(self.afz);
24169 __tmp.put_f32_le(self.yaw);
24170 __tmp.put_f32_le(self.yaw_rate);
24171 __tmp.put_u16_le(self.type_mask.bits());
24172 __tmp.put_u8(self.coordinate_frame as u8);
24173 if matches!(version, MavlinkVersion::V2) {
24174 let len = __tmp.len();
24175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24176 } else {
24177 __tmp.len()
24178 }
24179 }
24180}
24181#[doc = "id: 125"]
24182#[doc = "Power supply status."]
24183#[derive(Debug, Clone, PartialEq)]
24184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24186pub struct POWER_STATUS_DATA {
24187 #[doc = "5V rail voltage."]
24188 pub Vcc: u16,
24189 #[doc = "Servo rail voltage."]
24190 pub Vservo: u16,
24191 #[doc = "Bitmap of power supply status flags."]
24192 pub flags: MavPowerStatus,
24193}
24194impl POWER_STATUS_DATA {
24195 pub const ENCODED_LEN: usize = 6usize;
24196 pub const DEFAULT: Self = Self {
24197 Vcc: 0_u16,
24198 Vservo: 0_u16,
24199 flags: MavPowerStatus::DEFAULT,
24200 };
24201 #[cfg(feature = "arbitrary")]
24202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24203 use arbitrary::{Arbitrary, Unstructured};
24204 let mut buf = [0u8; 1024];
24205 rng.fill_bytes(&mut buf);
24206 let mut unstructured = Unstructured::new(&buf);
24207 Self::arbitrary(&mut unstructured).unwrap_or_default()
24208 }
24209}
24210impl Default for POWER_STATUS_DATA {
24211 fn default() -> Self {
24212 Self::DEFAULT.clone()
24213 }
24214}
24215impl MessageData for POWER_STATUS_DATA {
24216 type Message = MavMessage;
24217 const ID: u32 = 125u32;
24218 const NAME: &'static str = "POWER_STATUS";
24219 const EXTRA_CRC: u8 = 203u8;
24220 const ENCODED_LEN: usize = 6usize;
24221 fn deser(
24222 _version: MavlinkVersion,
24223 __input: &[u8],
24224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24225 let avail_len = __input.len();
24226 let mut payload_buf = [0; Self::ENCODED_LEN];
24227 let mut buf = if avail_len < Self::ENCODED_LEN {
24228 payload_buf[0..avail_len].copy_from_slice(__input);
24229 Bytes::new(&payload_buf)
24230 } else {
24231 Bytes::new(__input)
24232 };
24233 let mut __struct = Self::default();
24234 __struct.Vcc = buf.get_u16_le();
24235 __struct.Vservo = buf.get_u16_le();
24236 let tmp = buf.get_u16_le();
24237 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24238 ::mavlink_core::error::ParserError::InvalidFlag {
24239 flag_type: "MavPowerStatus",
24240 value: tmp as u32,
24241 },
24242 )?;
24243 Ok(__struct)
24244 }
24245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24246 let mut __tmp = BytesMut::new(bytes);
24247 #[allow(clippy::absurd_extreme_comparisons)]
24248 #[allow(unused_comparisons)]
24249 if __tmp.remaining() < Self::ENCODED_LEN {
24250 panic!(
24251 "buffer is too small (need {} bytes, but got {})",
24252 Self::ENCODED_LEN,
24253 __tmp.remaining(),
24254 )
24255 }
24256 __tmp.put_u16_le(self.Vcc);
24257 __tmp.put_u16_le(self.Vservo);
24258 __tmp.put_u16_le(self.flags.bits());
24259 if matches!(version, MavlinkVersion::V2) {
24260 let len = __tmp.len();
24261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24262 } else {
24263 __tmp.len()
24264 }
24265 }
24266}
24267#[doc = "id: 300"]
24268#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24269#[derive(Debug, Clone, PartialEq)]
24270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24272pub struct PROTOCOL_VERSION_DATA {
24273 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24274 pub version: u16,
24275 #[doc = "Minimum MAVLink version supported"]
24276 pub min_version: u16,
24277 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24278 pub max_version: u16,
24279 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24280 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24281 pub spec_version_hash: [u8; 8],
24282 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24283 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24284 pub library_version_hash: [u8; 8],
24285}
24286impl PROTOCOL_VERSION_DATA {
24287 pub const ENCODED_LEN: usize = 22usize;
24288 pub const DEFAULT: Self = Self {
24289 version: 0_u16,
24290 min_version: 0_u16,
24291 max_version: 0_u16,
24292 spec_version_hash: [0_u8; 8usize],
24293 library_version_hash: [0_u8; 8usize],
24294 };
24295 #[cfg(feature = "arbitrary")]
24296 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24297 use arbitrary::{Arbitrary, Unstructured};
24298 let mut buf = [0u8; 1024];
24299 rng.fill_bytes(&mut buf);
24300 let mut unstructured = Unstructured::new(&buf);
24301 Self::arbitrary(&mut unstructured).unwrap_or_default()
24302 }
24303}
24304impl Default for PROTOCOL_VERSION_DATA {
24305 fn default() -> Self {
24306 Self::DEFAULT.clone()
24307 }
24308}
24309impl MessageData for PROTOCOL_VERSION_DATA {
24310 type Message = MavMessage;
24311 const ID: u32 = 300u32;
24312 const NAME: &'static str = "PROTOCOL_VERSION";
24313 const EXTRA_CRC: u8 = 217u8;
24314 const ENCODED_LEN: usize = 22usize;
24315 fn deser(
24316 _version: MavlinkVersion,
24317 __input: &[u8],
24318 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24319 let avail_len = __input.len();
24320 let mut payload_buf = [0; Self::ENCODED_LEN];
24321 let mut buf = if avail_len < Self::ENCODED_LEN {
24322 payload_buf[0..avail_len].copy_from_slice(__input);
24323 Bytes::new(&payload_buf)
24324 } else {
24325 Bytes::new(__input)
24326 };
24327 let mut __struct = Self::default();
24328 __struct.version = buf.get_u16_le();
24329 __struct.min_version = buf.get_u16_le();
24330 __struct.max_version = buf.get_u16_le();
24331 for v in &mut __struct.spec_version_hash {
24332 let val = buf.get_u8();
24333 *v = val;
24334 }
24335 for v in &mut __struct.library_version_hash {
24336 let val = buf.get_u8();
24337 *v = val;
24338 }
24339 Ok(__struct)
24340 }
24341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24342 let mut __tmp = BytesMut::new(bytes);
24343 #[allow(clippy::absurd_extreme_comparisons)]
24344 #[allow(unused_comparisons)]
24345 if __tmp.remaining() < Self::ENCODED_LEN {
24346 panic!(
24347 "buffer is too small (need {} bytes, but got {})",
24348 Self::ENCODED_LEN,
24349 __tmp.remaining(),
24350 )
24351 }
24352 __tmp.put_u16_le(self.version);
24353 __tmp.put_u16_le(self.min_version);
24354 __tmp.put_u16_le(self.max_version);
24355 for val in &self.spec_version_hash {
24356 __tmp.put_u8(*val);
24357 }
24358 for val in &self.library_version_hash {
24359 __tmp.put_u8(*val);
24360 }
24361 if matches!(version, MavlinkVersion::V2) {
24362 let len = __tmp.len();
24363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24364 } else {
24365 __tmp.len()
24366 }
24367 }
24368}
24369#[doc = "id: 109"]
24370#[doc = "Status generated by radio and injected into MAVLink stream."]
24371#[derive(Debug, Clone, PartialEq)]
24372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24374pub struct RADIO_STATUS_DATA {
24375 #[doc = "Count of radio packet receive errors (since boot)."]
24376 pub rxerrors: u16,
24377 #[doc = "Count of error corrected radio packets (since boot)."]
24378 pub fixed: u16,
24379 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24380 pub rssi: u8,
24381 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24382 pub remrssi: u8,
24383 #[doc = "Remaining free transmitter buffer space."]
24384 pub txbuf: u8,
24385 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24386 pub noise: u8,
24387 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24388 pub remnoise: u8,
24389}
24390impl RADIO_STATUS_DATA {
24391 pub const ENCODED_LEN: usize = 9usize;
24392 pub const DEFAULT: Self = Self {
24393 rxerrors: 0_u16,
24394 fixed: 0_u16,
24395 rssi: 0_u8,
24396 remrssi: 0_u8,
24397 txbuf: 0_u8,
24398 noise: 0_u8,
24399 remnoise: 0_u8,
24400 };
24401 #[cfg(feature = "arbitrary")]
24402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24403 use arbitrary::{Arbitrary, Unstructured};
24404 let mut buf = [0u8; 1024];
24405 rng.fill_bytes(&mut buf);
24406 let mut unstructured = Unstructured::new(&buf);
24407 Self::arbitrary(&mut unstructured).unwrap_or_default()
24408 }
24409}
24410impl Default for RADIO_STATUS_DATA {
24411 fn default() -> Self {
24412 Self::DEFAULT.clone()
24413 }
24414}
24415impl MessageData for RADIO_STATUS_DATA {
24416 type Message = MavMessage;
24417 const ID: u32 = 109u32;
24418 const NAME: &'static str = "RADIO_STATUS";
24419 const EXTRA_CRC: u8 = 185u8;
24420 const ENCODED_LEN: usize = 9usize;
24421 fn deser(
24422 _version: MavlinkVersion,
24423 __input: &[u8],
24424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24425 let avail_len = __input.len();
24426 let mut payload_buf = [0; Self::ENCODED_LEN];
24427 let mut buf = if avail_len < Self::ENCODED_LEN {
24428 payload_buf[0..avail_len].copy_from_slice(__input);
24429 Bytes::new(&payload_buf)
24430 } else {
24431 Bytes::new(__input)
24432 };
24433 let mut __struct = Self::default();
24434 __struct.rxerrors = buf.get_u16_le();
24435 __struct.fixed = buf.get_u16_le();
24436 __struct.rssi = buf.get_u8();
24437 __struct.remrssi = buf.get_u8();
24438 __struct.txbuf = buf.get_u8();
24439 __struct.noise = buf.get_u8();
24440 __struct.remnoise = buf.get_u8();
24441 Ok(__struct)
24442 }
24443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24444 let mut __tmp = BytesMut::new(bytes);
24445 #[allow(clippy::absurd_extreme_comparisons)]
24446 #[allow(unused_comparisons)]
24447 if __tmp.remaining() < Self::ENCODED_LEN {
24448 panic!(
24449 "buffer is too small (need {} bytes, but got {})",
24450 Self::ENCODED_LEN,
24451 __tmp.remaining(),
24452 )
24453 }
24454 __tmp.put_u16_le(self.rxerrors);
24455 __tmp.put_u16_le(self.fixed);
24456 __tmp.put_u8(self.rssi);
24457 __tmp.put_u8(self.remrssi);
24458 __tmp.put_u8(self.txbuf);
24459 __tmp.put_u8(self.noise);
24460 __tmp.put_u8(self.remnoise);
24461 if matches!(version, MavlinkVersion::V2) {
24462 let len = __tmp.len();
24463 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24464 } else {
24465 __tmp.len()
24466 }
24467 }
24468}
24469#[doc = "id: 27"]
24470#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24471#[derive(Debug, Clone, PartialEq)]
24472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24474pub struct RAW_IMU_DATA {
24475 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24476 pub time_usec: u64,
24477 #[doc = "X acceleration (raw)"]
24478 pub xacc: i16,
24479 #[doc = "Y acceleration (raw)"]
24480 pub yacc: i16,
24481 #[doc = "Z acceleration (raw)"]
24482 pub zacc: i16,
24483 #[doc = "Angular speed around X axis (raw)"]
24484 pub xgyro: i16,
24485 #[doc = "Angular speed around Y axis (raw)"]
24486 pub ygyro: i16,
24487 #[doc = "Angular speed around Z axis (raw)"]
24488 pub zgyro: i16,
24489 #[doc = "X Magnetic field (raw)"]
24490 pub xmag: i16,
24491 #[doc = "Y Magnetic field (raw)"]
24492 pub ymag: i16,
24493 #[doc = "Z Magnetic field (raw)"]
24494 pub zmag: i16,
24495 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24497 pub id: u8,
24498 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24499 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24500 pub temperature: i16,
24501}
24502impl RAW_IMU_DATA {
24503 pub const ENCODED_LEN: usize = 29usize;
24504 pub const DEFAULT: Self = Self {
24505 time_usec: 0_u64,
24506 xacc: 0_i16,
24507 yacc: 0_i16,
24508 zacc: 0_i16,
24509 xgyro: 0_i16,
24510 ygyro: 0_i16,
24511 zgyro: 0_i16,
24512 xmag: 0_i16,
24513 ymag: 0_i16,
24514 zmag: 0_i16,
24515 id: 0_u8,
24516 temperature: 0_i16,
24517 };
24518 #[cfg(feature = "arbitrary")]
24519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24520 use arbitrary::{Arbitrary, Unstructured};
24521 let mut buf = [0u8; 1024];
24522 rng.fill_bytes(&mut buf);
24523 let mut unstructured = Unstructured::new(&buf);
24524 Self::arbitrary(&mut unstructured).unwrap_or_default()
24525 }
24526}
24527impl Default for RAW_IMU_DATA {
24528 fn default() -> Self {
24529 Self::DEFAULT.clone()
24530 }
24531}
24532impl MessageData for RAW_IMU_DATA {
24533 type Message = MavMessage;
24534 const ID: u32 = 27u32;
24535 const NAME: &'static str = "RAW_IMU";
24536 const EXTRA_CRC: u8 = 144u8;
24537 const ENCODED_LEN: usize = 29usize;
24538 fn deser(
24539 _version: MavlinkVersion,
24540 __input: &[u8],
24541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24542 let avail_len = __input.len();
24543 let mut payload_buf = [0; Self::ENCODED_LEN];
24544 let mut buf = if avail_len < Self::ENCODED_LEN {
24545 payload_buf[0..avail_len].copy_from_slice(__input);
24546 Bytes::new(&payload_buf)
24547 } else {
24548 Bytes::new(__input)
24549 };
24550 let mut __struct = Self::default();
24551 __struct.time_usec = buf.get_u64_le();
24552 __struct.xacc = buf.get_i16_le();
24553 __struct.yacc = buf.get_i16_le();
24554 __struct.zacc = buf.get_i16_le();
24555 __struct.xgyro = buf.get_i16_le();
24556 __struct.ygyro = buf.get_i16_le();
24557 __struct.zgyro = buf.get_i16_le();
24558 __struct.xmag = buf.get_i16_le();
24559 __struct.ymag = buf.get_i16_le();
24560 __struct.zmag = buf.get_i16_le();
24561 __struct.id = buf.get_u8();
24562 __struct.temperature = buf.get_i16_le();
24563 Ok(__struct)
24564 }
24565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24566 let mut __tmp = BytesMut::new(bytes);
24567 #[allow(clippy::absurd_extreme_comparisons)]
24568 #[allow(unused_comparisons)]
24569 if __tmp.remaining() < Self::ENCODED_LEN {
24570 panic!(
24571 "buffer is too small (need {} bytes, but got {})",
24572 Self::ENCODED_LEN,
24573 __tmp.remaining(),
24574 )
24575 }
24576 __tmp.put_u64_le(self.time_usec);
24577 __tmp.put_i16_le(self.xacc);
24578 __tmp.put_i16_le(self.yacc);
24579 __tmp.put_i16_le(self.zacc);
24580 __tmp.put_i16_le(self.xgyro);
24581 __tmp.put_i16_le(self.ygyro);
24582 __tmp.put_i16_le(self.zgyro);
24583 __tmp.put_i16_le(self.xmag);
24584 __tmp.put_i16_le(self.ymag);
24585 __tmp.put_i16_le(self.zmag);
24586 __tmp.put_u8(self.id);
24587 __tmp.put_i16_le(self.temperature);
24588 if matches!(version, MavlinkVersion::V2) {
24589 let len = __tmp.len();
24590 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24591 } else {
24592 __tmp.len()
24593 }
24594 }
24595}
24596#[doc = "id: 28"]
24597#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24598#[derive(Debug, Clone, PartialEq)]
24599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24601pub struct RAW_PRESSURE_DATA {
24602 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24603 pub time_usec: u64,
24604 #[doc = "Absolute pressure (raw)"]
24605 pub press_abs: i16,
24606 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24607 pub press_diff1: i16,
24608 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24609 pub press_diff2: i16,
24610 #[doc = "Raw Temperature measurement (raw)"]
24611 pub temperature: i16,
24612}
24613impl RAW_PRESSURE_DATA {
24614 pub const ENCODED_LEN: usize = 16usize;
24615 pub const DEFAULT: Self = Self {
24616 time_usec: 0_u64,
24617 press_abs: 0_i16,
24618 press_diff1: 0_i16,
24619 press_diff2: 0_i16,
24620 temperature: 0_i16,
24621 };
24622 #[cfg(feature = "arbitrary")]
24623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24624 use arbitrary::{Arbitrary, Unstructured};
24625 let mut buf = [0u8; 1024];
24626 rng.fill_bytes(&mut buf);
24627 let mut unstructured = Unstructured::new(&buf);
24628 Self::arbitrary(&mut unstructured).unwrap_or_default()
24629 }
24630}
24631impl Default for RAW_PRESSURE_DATA {
24632 fn default() -> Self {
24633 Self::DEFAULT.clone()
24634 }
24635}
24636impl MessageData for RAW_PRESSURE_DATA {
24637 type Message = MavMessage;
24638 const ID: u32 = 28u32;
24639 const NAME: &'static str = "RAW_PRESSURE";
24640 const EXTRA_CRC: u8 = 67u8;
24641 const ENCODED_LEN: usize = 16usize;
24642 fn deser(
24643 _version: MavlinkVersion,
24644 __input: &[u8],
24645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24646 let avail_len = __input.len();
24647 let mut payload_buf = [0; Self::ENCODED_LEN];
24648 let mut buf = if avail_len < Self::ENCODED_LEN {
24649 payload_buf[0..avail_len].copy_from_slice(__input);
24650 Bytes::new(&payload_buf)
24651 } else {
24652 Bytes::new(__input)
24653 };
24654 let mut __struct = Self::default();
24655 __struct.time_usec = buf.get_u64_le();
24656 __struct.press_abs = buf.get_i16_le();
24657 __struct.press_diff1 = buf.get_i16_le();
24658 __struct.press_diff2 = buf.get_i16_le();
24659 __struct.temperature = buf.get_i16_le();
24660 Ok(__struct)
24661 }
24662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24663 let mut __tmp = BytesMut::new(bytes);
24664 #[allow(clippy::absurd_extreme_comparisons)]
24665 #[allow(unused_comparisons)]
24666 if __tmp.remaining() < Self::ENCODED_LEN {
24667 panic!(
24668 "buffer is too small (need {} bytes, but got {})",
24669 Self::ENCODED_LEN,
24670 __tmp.remaining(),
24671 )
24672 }
24673 __tmp.put_u64_le(self.time_usec);
24674 __tmp.put_i16_le(self.press_abs);
24675 __tmp.put_i16_le(self.press_diff1);
24676 __tmp.put_i16_le(self.press_diff2);
24677 __tmp.put_i16_le(self.temperature);
24678 if matches!(version, MavlinkVersion::V2) {
24679 let len = __tmp.len();
24680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24681 } else {
24682 __tmp.len()
24683 }
24684 }
24685}
24686#[doc = "id: 339"]
24687#[doc = "RPM sensor data message."]
24688#[derive(Debug, Clone, PartialEq)]
24689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24691pub struct RAW_RPM_DATA {
24692 #[doc = "Indicated rate"]
24693 pub frequency: f32,
24694 #[doc = "Index of this RPM sensor (0-indexed)"]
24695 pub index: u8,
24696}
24697impl RAW_RPM_DATA {
24698 pub const ENCODED_LEN: usize = 5usize;
24699 pub const DEFAULT: Self = Self {
24700 frequency: 0.0_f32,
24701 index: 0_u8,
24702 };
24703 #[cfg(feature = "arbitrary")]
24704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24705 use arbitrary::{Arbitrary, Unstructured};
24706 let mut buf = [0u8; 1024];
24707 rng.fill_bytes(&mut buf);
24708 let mut unstructured = Unstructured::new(&buf);
24709 Self::arbitrary(&mut unstructured).unwrap_or_default()
24710 }
24711}
24712impl Default for RAW_RPM_DATA {
24713 fn default() -> Self {
24714 Self::DEFAULT.clone()
24715 }
24716}
24717impl MessageData for RAW_RPM_DATA {
24718 type Message = MavMessage;
24719 const ID: u32 = 339u32;
24720 const NAME: &'static str = "RAW_RPM";
24721 const EXTRA_CRC: u8 = 199u8;
24722 const ENCODED_LEN: usize = 5usize;
24723 fn deser(
24724 _version: MavlinkVersion,
24725 __input: &[u8],
24726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24727 let avail_len = __input.len();
24728 let mut payload_buf = [0; Self::ENCODED_LEN];
24729 let mut buf = if avail_len < Self::ENCODED_LEN {
24730 payload_buf[0..avail_len].copy_from_slice(__input);
24731 Bytes::new(&payload_buf)
24732 } else {
24733 Bytes::new(__input)
24734 };
24735 let mut __struct = Self::default();
24736 __struct.frequency = buf.get_f32_le();
24737 __struct.index = buf.get_u8();
24738 Ok(__struct)
24739 }
24740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24741 let mut __tmp = BytesMut::new(bytes);
24742 #[allow(clippy::absurd_extreme_comparisons)]
24743 #[allow(unused_comparisons)]
24744 if __tmp.remaining() < Self::ENCODED_LEN {
24745 panic!(
24746 "buffer is too small (need {} bytes, but got {})",
24747 Self::ENCODED_LEN,
24748 __tmp.remaining(),
24749 )
24750 }
24751 __tmp.put_f32_le(self.frequency);
24752 __tmp.put_u8(self.index);
24753 if matches!(version, MavlinkVersion::V2) {
24754 let len = __tmp.len();
24755 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24756 } else {
24757 __tmp.len()
24758 }
24759 }
24760}
24761#[doc = "id: 65"]
24762#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24763#[derive(Debug, Clone, PartialEq)]
24764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24766pub struct RC_CHANNELS_DATA {
24767 #[doc = "Timestamp (time since system boot)."]
24768 pub time_boot_ms: u32,
24769 #[doc = "RC channel 1 value."]
24770 pub chan1_raw: u16,
24771 #[doc = "RC channel 2 value."]
24772 pub chan2_raw: u16,
24773 #[doc = "RC channel 3 value."]
24774 pub chan3_raw: u16,
24775 #[doc = "RC channel 4 value."]
24776 pub chan4_raw: u16,
24777 #[doc = "RC channel 5 value."]
24778 pub chan5_raw: u16,
24779 #[doc = "RC channel 6 value."]
24780 pub chan6_raw: u16,
24781 #[doc = "RC channel 7 value."]
24782 pub chan7_raw: u16,
24783 #[doc = "RC channel 8 value."]
24784 pub chan8_raw: u16,
24785 #[doc = "RC channel 9 value."]
24786 pub chan9_raw: u16,
24787 #[doc = "RC channel 10 value."]
24788 pub chan10_raw: u16,
24789 #[doc = "RC channel 11 value."]
24790 pub chan11_raw: u16,
24791 #[doc = "RC channel 12 value."]
24792 pub chan12_raw: u16,
24793 #[doc = "RC channel 13 value."]
24794 pub chan13_raw: u16,
24795 #[doc = "RC channel 14 value."]
24796 pub chan14_raw: u16,
24797 #[doc = "RC channel 15 value."]
24798 pub chan15_raw: u16,
24799 #[doc = "RC channel 16 value."]
24800 pub chan16_raw: u16,
24801 #[doc = "RC channel 17 value."]
24802 pub chan17_raw: u16,
24803 #[doc = "RC channel 18 value."]
24804 pub chan18_raw: u16,
24805 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24806 pub chancount: u8,
24807 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24808 pub rssi: u8,
24809}
24810impl RC_CHANNELS_DATA {
24811 pub const ENCODED_LEN: usize = 42usize;
24812 pub const DEFAULT: Self = Self {
24813 time_boot_ms: 0_u32,
24814 chan1_raw: 0_u16,
24815 chan2_raw: 0_u16,
24816 chan3_raw: 0_u16,
24817 chan4_raw: 0_u16,
24818 chan5_raw: 0_u16,
24819 chan6_raw: 0_u16,
24820 chan7_raw: 0_u16,
24821 chan8_raw: 0_u16,
24822 chan9_raw: 0_u16,
24823 chan10_raw: 0_u16,
24824 chan11_raw: 0_u16,
24825 chan12_raw: 0_u16,
24826 chan13_raw: 0_u16,
24827 chan14_raw: 0_u16,
24828 chan15_raw: 0_u16,
24829 chan16_raw: 0_u16,
24830 chan17_raw: 0_u16,
24831 chan18_raw: 0_u16,
24832 chancount: 0_u8,
24833 rssi: 0_u8,
24834 };
24835 #[cfg(feature = "arbitrary")]
24836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24837 use arbitrary::{Arbitrary, Unstructured};
24838 let mut buf = [0u8; 1024];
24839 rng.fill_bytes(&mut buf);
24840 let mut unstructured = Unstructured::new(&buf);
24841 Self::arbitrary(&mut unstructured).unwrap_or_default()
24842 }
24843}
24844impl Default for RC_CHANNELS_DATA {
24845 fn default() -> Self {
24846 Self::DEFAULT.clone()
24847 }
24848}
24849impl MessageData for RC_CHANNELS_DATA {
24850 type Message = MavMessage;
24851 const ID: u32 = 65u32;
24852 const NAME: &'static str = "RC_CHANNELS";
24853 const EXTRA_CRC: u8 = 118u8;
24854 const ENCODED_LEN: usize = 42usize;
24855 fn deser(
24856 _version: MavlinkVersion,
24857 __input: &[u8],
24858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24859 let avail_len = __input.len();
24860 let mut payload_buf = [0; Self::ENCODED_LEN];
24861 let mut buf = if avail_len < Self::ENCODED_LEN {
24862 payload_buf[0..avail_len].copy_from_slice(__input);
24863 Bytes::new(&payload_buf)
24864 } else {
24865 Bytes::new(__input)
24866 };
24867 let mut __struct = Self::default();
24868 __struct.time_boot_ms = buf.get_u32_le();
24869 __struct.chan1_raw = buf.get_u16_le();
24870 __struct.chan2_raw = buf.get_u16_le();
24871 __struct.chan3_raw = buf.get_u16_le();
24872 __struct.chan4_raw = buf.get_u16_le();
24873 __struct.chan5_raw = buf.get_u16_le();
24874 __struct.chan6_raw = buf.get_u16_le();
24875 __struct.chan7_raw = buf.get_u16_le();
24876 __struct.chan8_raw = buf.get_u16_le();
24877 __struct.chan9_raw = buf.get_u16_le();
24878 __struct.chan10_raw = buf.get_u16_le();
24879 __struct.chan11_raw = buf.get_u16_le();
24880 __struct.chan12_raw = buf.get_u16_le();
24881 __struct.chan13_raw = buf.get_u16_le();
24882 __struct.chan14_raw = buf.get_u16_le();
24883 __struct.chan15_raw = buf.get_u16_le();
24884 __struct.chan16_raw = buf.get_u16_le();
24885 __struct.chan17_raw = buf.get_u16_le();
24886 __struct.chan18_raw = buf.get_u16_le();
24887 __struct.chancount = buf.get_u8();
24888 __struct.rssi = buf.get_u8();
24889 Ok(__struct)
24890 }
24891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24892 let mut __tmp = BytesMut::new(bytes);
24893 #[allow(clippy::absurd_extreme_comparisons)]
24894 #[allow(unused_comparisons)]
24895 if __tmp.remaining() < Self::ENCODED_LEN {
24896 panic!(
24897 "buffer is too small (need {} bytes, but got {})",
24898 Self::ENCODED_LEN,
24899 __tmp.remaining(),
24900 )
24901 }
24902 __tmp.put_u32_le(self.time_boot_ms);
24903 __tmp.put_u16_le(self.chan1_raw);
24904 __tmp.put_u16_le(self.chan2_raw);
24905 __tmp.put_u16_le(self.chan3_raw);
24906 __tmp.put_u16_le(self.chan4_raw);
24907 __tmp.put_u16_le(self.chan5_raw);
24908 __tmp.put_u16_le(self.chan6_raw);
24909 __tmp.put_u16_le(self.chan7_raw);
24910 __tmp.put_u16_le(self.chan8_raw);
24911 __tmp.put_u16_le(self.chan9_raw);
24912 __tmp.put_u16_le(self.chan10_raw);
24913 __tmp.put_u16_le(self.chan11_raw);
24914 __tmp.put_u16_le(self.chan12_raw);
24915 __tmp.put_u16_le(self.chan13_raw);
24916 __tmp.put_u16_le(self.chan14_raw);
24917 __tmp.put_u16_le(self.chan15_raw);
24918 __tmp.put_u16_le(self.chan16_raw);
24919 __tmp.put_u16_le(self.chan17_raw);
24920 __tmp.put_u16_le(self.chan18_raw);
24921 __tmp.put_u8(self.chancount);
24922 __tmp.put_u8(self.rssi);
24923 if matches!(version, MavlinkVersion::V2) {
24924 let len = __tmp.len();
24925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24926 } else {
24927 __tmp.len()
24928 }
24929 }
24930}
24931#[doc = "id: 70"]
24932#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24933#[derive(Debug, Clone, PartialEq)]
24934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24936pub struct RC_CHANNELS_OVERRIDE_DATA {
24937 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24938 pub chan1_raw: u16,
24939 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24940 pub chan2_raw: u16,
24941 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24942 pub chan3_raw: u16,
24943 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24944 pub chan4_raw: u16,
24945 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24946 pub chan5_raw: u16,
24947 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24948 pub chan6_raw: u16,
24949 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24950 pub chan7_raw: u16,
24951 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24952 pub chan8_raw: u16,
24953 #[doc = "System ID"]
24954 pub target_system: u8,
24955 #[doc = "Component ID"]
24956 pub target_component: u8,
24957 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24958 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24959 pub chan9_raw: u16,
24960 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24962 pub chan10_raw: u16,
24963 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24964 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24965 pub chan11_raw: u16,
24966 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24967 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24968 pub chan12_raw: u16,
24969 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24970 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24971 pub chan13_raw: u16,
24972 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24973 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24974 pub chan14_raw: u16,
24975 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24977 pub chan15_raw: u16,
24978 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24980 pub chan16_raw: u16,
24981 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24983 pub chan17_raw: u16,
24984 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24985 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24986 pub chan18_raw: u16,
24987}
24988impl RC_CHANNELS_OVERRIDE_DATA {
24989 pub const ENCODED_LEN: usize = 38usize;
24990 pub const DEFAULT: Self = Self {
24991 chan1_raw: 0_u16,
24992 chan2_raw: 0_u16,
24993 chan3_raw: 0_u16,
24994 chan4_raw: 0_u16,
24995 chan5_raw: 0_u16,
24996 chan6_raw: 0_u16,
24997 chan7_raw: 0_u16,
24998 chan8_raw: 0_u16,
24999 target_system: 0_u8,
25000 target_component: 0_u8,
25001 chan9_raw: 0_u16,
25002 chan10_raw: 0_u16,
25003 chan11_raw: 0_u16,
25004 chan12_raw: 0_u16,
25005 chan13_raw: 0_u16,
25006 chan14_raw: 0_u16,
25007 chan15_raw: 0_u16,
25008 chan16_raw: 0_u16,
25009 chan17_raw: 0_u16,
25010 chan18_raw: 0_u16,
25011 };
25012 #[cfg(feature = "arbitrary")]
25013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25014 use arbitrary::{Arbitrary, Unstructured};
25015 let mut buf = [0u8; 1024];
25016 rng.fill_bytes(&mut buf);
25017 let mut unstructured = Unstructured::new(&buf);
25018 Self::arbitrary(&mut unstructured).unwrap_or_default()
25019 }
25020}
25021impl Default for RC_CHANNELS_OVERRIDE_DATA {
25022 fn default() -> Self {
25023 Self::DEFAULT.clone()
25024 }
25025}
25026impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25027 type Message = MavMessage;
25028 const ID: u32 = 70u32;
25029 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25030 const EXTRA_CRC: u8 = 124u8;
25031 const ENCODED_LEN: usize = 38usize;
25032 fn deser(
25033 _version: MavlinkVersion,
25034 __input: &[u8],
25035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25036 let avail_len = __input.len();
25037 let mut payload_buf = [0; Self::ENCODED_LEN];
25038 let mut buf = if avail_len < Self::ENCODED_LEN {
25039 payload_buf[0..avail_len].copy_from_slice(__input);
25040 Bytes::new(&payload_buf)
25041 } else {
25042 Bytes::new(__input)
25043 };
25044 let mut __struct = Self::default();
25045 __struct.chan1_raw = buf.get_u16_le();
25046 __struct.chan2_raw = buf.get_u16_le();
25047 __struct.chan3_raw = buf.get_u16_le();
25048 __struct.chan4_raw = buf.get_u16_le();
25049 __struct.chan5_raw = buf.get_u16_le();
25050 __struct.chan6_raw = buf.get_u16_le();
25051 __struct.chan7_raw = buf.get_u16_le();
25052 __struct.chan8_raw = buf.get_u16_le();
25053 __struct.target_system = buf.get_u8();
25054 __struct.target_component = buf.get_u8();
25055 __struct.chan9_raw = buf.get_u16_le();
25056 __struct.chan10_raw = buf.get_u16_le();
25057 __struct.chan11_raw = buf.get_u16_le();
25058 __struct.chan12_raw = buf.get_u16_le();
25059 __struct.chan13_raw = buf.get_u16_le();
25060 __struct.chan14_raw = buf.get_u16_le();
25061 __struct.chan15_raw = buf.get_u16_le();
25062 __struct.chan16_raw = buf.get_u16_le();
25063 __struct.chan17_raw = buf.get_u16_le();
25064 __struct.chan18_raw = buf.get_u16_le();
25065 Ok(__struct)
25066 }
25067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25068 let mut __tmp = BytesMut::new(bytes);
25069 #[allow(clippy::absurd_extreme_comparisons)]
25070 #[allow(unused_comparisons)]
25071 if __tmp.remaining() < Self::ENCODED_LEN {
25072 panic!(
25073 "buffer is too small (need {} bytes, but got {})",
25074 Self::ENCODED_LEN,
25075 __tmp.remaining(),
25076 )
25077 }
25078 __tmp.put_u16_le(self.chan1_raw);
25079 __tmp.put_u16_le(self.chan2_raw);
25080 __tmp.put_u16_le(self.chan3_raw);
25081 __tmp.put_u16_le(self.chan4_raw);
25082 __tmp.put_u16_le(self.chan5_raw);
25083 __tmp.put_u16_le(self.chan6_raw);
25084 __tmp.put_u16_le(self.chan7_raw);
25085 __tmp.put_u16_le(self.chan8_raw);
25086 __tmp.put_u8(self.target_system);
25087 __tmp.put_u8(self.target_component);
25088 __tmp.put_u16_le(self.chan9_raw);
25089 __tmp.put_u16_le(self.chan10_raw);
25090 __tmp.put_u16_le(self.chan11_raw);
25091 __tmp.put_u16_le(self.chan12_raw);
25092 __tmp.put_u16_le(self.chan13_raw);
25093 __tmp.put_u16_le(self.chan14_raw);
25094 __tmp.put_u16_le(self.chan15_raw);
25095 __tmp.put_u16_le(self.chan16_raw);
25096 __tmp.put_u16_le(self.chan17_raw);
25097 __tmp.put_u16_le(self.chan18_raw);
25098 if matches!(version, MavlinkVersion::V2) {
25099 let len = __tmp.len();
25100 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25101 } else {
25102 __tmp.len()
25103 }
25104 }
25105}
25106#[doc = "id: 35"]
25107#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25108#[derive(Debug, Clone, PartialEq)]
25109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25111pub struct RC_CHANNELS_RAW_DATA {
25112 #[doc = "Timestamp (time since system boot)."]
25113 pub time_boot_ms: u32,
25114 #[doc = "RC channel 1 value."]
25115 pub chan1_raw: u16,
25116 #[doc = "RC channel 2 value."]
25117 pub chan2_raw: u16,
25118 #[doc = "RC channel 3 value."]
25119 pub chan3_raw: u16,
25120 #[doc = "RC channel 4 value."]
25121 pub chan4_raw: u16,
25122 #[doc = "RC channel 5 value."]
25123 pub chan5_raw: u16,
25124 #[doc = "RC channel 6 value."]
25125 pub chan6_raw: u16,
25126 #[doc = "RC channel 7 value."]
25127 pub chan7_raw: u16,
25128 #[doc = "RC channel 8 value."]
25129 pub chan8_raw: u16,
25130 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25131 pub port: u8,
25132 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25133 pub rssi: u8,
25134}
25135impl RC_CHANNELS_RAW_DATA {
25136 pub const ENCODED_LEN: usize = 22usize;
25137 pub const DEFAULT: Self = Self {
25138 time_boot_ms: 0_u32,
25139 chan1_raw: 0_u16,
25140 chan2_raw: 0_u16,
25141 chan3_raw: 0_u16,
25142 chan4_raw: 0_u16,
25143 chan5_raw: 0_u16,
25144 chan6_raw: 0_u16,
25145 chan7_raw: 0_u16,
25146 chan8_raw: 0_u16,
25147 port: 0_u8,
25148 rssi: 0_u8,
25149 };
25150 #[cfg(feature = "arbitrary")]
25151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25152 use arbitrary::{Arbitrary, Unstructured};
25153 let mut buf = [0u8; 1024];
25154 rng.fill_bytes(&mut buf);
25155 let mut unstructured = Unstructured::new(&buf);
25156 Self::arbitrary(&mut unstructured).unwrap_or_default()
25157 }
25158}
25159impl Default for RC_CHANNELS_RAW_DATA {
25160 fn default() -> Self {
25161 Self::DEFAULT.clone()
25162 }
25163}
25164impl MessageData for RC_CHANNELS_RAW_DATA {
25165 type Message = MavMessage;
25166 const ID: u32 = 35u32;
25167 const NAME: &'static str = "RC_CHANNELS_RAW";
25168 const EXTRA_CRC: u8 = 244u8;
25169 const ENCODED_LEN: usize = 22usize;
25170 fn deser(
25171 _version: MavlinkVersion,
25172 __input: &[u8],
25173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25174 let avail_len = __input.len();
25175 let mut payload_buf = [0; Self::ENCODED_LEN];
25176 let mut buf = if avail_len < Self::ENCODED_LEN {
25177 payload_buf[0..avail_len].copy_from_slice(__input);
25178 Bytes::new(&payload_buf)
25179 } else {
25180 Bytes::new(__input)
25181 };
25182 let mut __struct = Self::default();
25183 __struct.time_boot_ms = buf.get_u32_le();
25184 __struct.chan1_raw = buf.get_u16_le();
25185 __struct.chan2_raw = buf.get_u16_le();
25186 __struct.chan3_raw = buf.get_u16_le();
25187 __struct.chan4_raw = buf.get_u16_le();
25188 __struct.chan5_raw = buf.get_u16_le();
25189 __struct.chan6_raw = buf.get_u16_le();
25190 __struct.chan7_raw = buf.get_u16_le();
25191 __struct.chan8_raw = buf.get_u16_le();
25192 __struct.port = buf.get_u8();
25193 __struct.rssi = buf.get_u8();
25194 Ok(__struct)
25195 }
25196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25197 let mut __tmp = BytesMut::new(bytes);
25198 #[allow(clippy::absurd_extreme_comparisons)]
25199 #[allow(unused_comparisons)]
25200 if __tmp.remaining() < Self::ENCODED_LEN {
25201 panic!(
25202 "buffer is too small (need {} bytes, but got {})",
25203 Self::ENCODED_LEN,
25204 __tmp.remaining(),
25205 )
25206 }
25207 __tmp.put_u32_le(self.time_boot_ms);
25208 __tmp.put_u16_le(self.chan1_raw);
25209 __tmp.put_u16_le(self.chan2_raw);
25210 __tmp.put_u16_le(self.chan3_raw);
25211 __tmp.put_u16_le(self.chan4_raw);
25212 __tmp.put_u16_le(self.chan5_raw);
25213 __tmp.put_u16_le(self.chan6_raw);
25214 __tmp.put_u16_le(self.chan7_raw);
25215 __tmp.put_u16_le(self.chan8_raw);
25216 __tmp.put_u8(self.port);
25217 __tmp.put_u8(self.rssi);
25218 if matches!(version, MavlinkVersion::V2) {
25219 let len = __tmp.len();
25220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25221 } else {
25222 __tmp.len()
25223 }
25224 }
25225}
25226#[doc = "id: 34"]
25227#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25228#[derive(Debug, Clone, PartialEq)]
25229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25231pub struct RC_CHANNELS_SCALED_DATA {
25232 #[doc = "Timestamp (time since system boot)."]
25233 pub time_boot_ms: u32,
25234 #[doc = "RC channel 1 value scaled."]
25235 pub chan1_scaled: i16,
25236 #[doc = "RC channel 2 value scaled."]
25237 pub chan2_scaled: i16,
25238 #[doc = "RC channel 3 value scaled."]
25239 pub chan3_scaled: i16,
25240 #[doc = "RC channel 4 value scaled."]
25241 pub chan4_scaled: i16,
25242 #[doc = "RC channel 5 value scaled."]
25243 pub chan5_scaled: i16,
25244 #[doc = "RC channel 6 value scaled."]
25245 pub chan6_scaled: i16,
25246 #[doc = "RC channel 7 value scaled."]
25247 pub chan7_scaled: i16,
25248 #[doc = "RC channel 8 value scaled."]
25249 pub chan8_scaled: i16,
25250 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25251 pub port: u8,
25252 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25253 pub rssi: u8,
25254}
25255impl RC_CHANNELS_SCALED_DATA {
25256 pub const ENCODED_LEN: usize = 22usize;
25257 pub const DEFAULT: Self = Self {
25258 time_boot_ms: 0_u32,
25259 chan1_scaled: 0_i16,
25260 chan2_scaled: 0_i16,
25261 chan3_scaled: 0_i16,
25262 chan4_scaled: 0_i16,
25263 chan5_scaled: 0_i16,
25264 chan6_scaled: 0_i16,
25265 chan7_scaled: 0_i16,
25266 chan8_scaled: 0_i16,
25267 port: 0_u8,
25268 rssi: 0_u8,
25269 };
25270 #[cfg(feature = "arbitrary")]
25271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25272 use arbitrary::{Arbitrary, Unstructured};
25273 let mut buf = [0u8; 1024];
25274 rng.fill_bytes(&mut buf);
25275 let mut unstructured = Unstructured::new(&buf);
25276 Self::arbitrary(&mut unstructured).unwrap_or_default()
25277 }
25278}
25279impl Default for RC_CHANNELS_SCALED_DATA {
25280 fn default() -> Self {
25281 Self::DEFAULT.clone()
25282 }
25283}
25284impl MessageData for RC_CHANNELS_SCALED_DATA {
25285 type Message = MavMessage;
25286 const ID: u32 = 34u32;
25287 const NAME: &'static str = "RC_CHANNELS_SCALED";
25288 const EXTRA_CRC: u8 = 237u8;
25289 const ENCODED_LEN: usize = 22usize;
25290 fn deser(
25291 _version: MavlinkVersion,
25292 __input: &[u8],
25293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25294 let avail_len = __input.len();
25295 let mut payload_buf = [0; Self::ENCODED_LEN];
25296 let mut buf = if avail_len < Self::ENCODED_LEN {
25297 payload_buf[0..avail_len].copy_from_slice(__input);
25298 Bytes::new(&payload_buf)
25299 } else {
25300 Bytes::new(__input)
25301 };
25302 let mut __struct = Self::default();
25303 __struct.time_boot_ms = buf.get_u32_le();
25304 __struct.chan1_scaled = buf.get_i16_le();
25305 __struct.chan2_scaled = buf.get_i16_le();
25306 __struct.chan3_scaled = buf.get_i16_le();
25307 __struct.chan4_scaled = buf.get_i16_le();
25308 __struct.chan5_scaled = buf.get_i16_le();
25309 __struct.chan6_scaled = buf.get_i16_le();
25310 __struct.chan7_scaled = buf.get_i16_le();
25311 __struct.chan8_scaled = buf.get_i16_le();
25312 __struct.port = buf.get_u8();
25313 __struct.rssi = buf.get_u8();
25314 Ok(__struct)
25315 }
25316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25317 let mut __tmp = BytesMut::new(bytes);
25318 #[allow(clippy::absurd_extreme_comparisons)]
25319 #[allow(unused_comparisons)]
25320 if __tmp.remaining() < Self::ENCODED_LEN {
25321 panic!(
25322 "buffer is too small (need {} bytes, but got {})",
25323 Self::ENCODED_LEN,
25324 __tmp.remaining(),
25325 )
25326 }
25327 __tmp.put_u32_le(self.time_boot_ms);
25328 __tmp.put_i16_le(self.chan1_scaled);
25329 __tmp.put_i16_le(self.chan2_scaled);
25330 __tmp.put_i16_le(self.chan3_scaled);
25331 __tmp.put_i16_le(self.chan4_scaled);
25332 __tmp.put_i16_le(self.chan5_scaled);
25333 __tmp.put_i16_le(self.chan6_scaled);
25334 __tmp.put_i16_le(self.chan7_scaled);
25335 __tmp.put_i16_le(self.chan8_scaled);
25336 __tmp.put_u8(self.port);
25337 __tmp.put_u8(self.rssi);
25338 if matches!(version, MavlinkVersion::V2) {
25339 let len = __tmp.len();
25340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25341 } else {
25342 __tmp.len()
25343 }
25344 }
25345}
25346#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25347#[doc = "id: 66"]
25348#[doc = "Request a data stream."]
25349#[derive(Debug, Clone, PartialEq)]
25350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25352pub struct REQUEST_DATA_STREAM_DATA {
25353 #[doc = "The requested message rate"]
25354 pub req_message_rate: u16,
25355 #[doc = "The target requested to send the message stream."]
25356 pub target_system: u8,
25357 #[doc = "The target requested to send the message stream."]
25358 pub target_component: u8,
25359 #[doc = "The ID of the requested data stream"]
25360 pub req_stream_id: u8,
25361 #[doc = "1 to start sending, 0 to stop sending."]
25362 pub start_stop: u8,
25363}
25364impl REQUEST_DATA_STREAM_DATA {
25365 pub const ENCODED_LEN: usize = 6usize;
25366 pub const DEFAULT: Self = Self {
25367 req_message_rate: 0_u16,
25368 target_system: 0_u8,
25369 target_component: 0_u8,
25370 req_stream_id: 0_u8,
25371 start_stop: 0_u8,
25372 };
25373 #[cfg(feature = "arbitrary")]
25374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25375 use arbitrary::{Arbitrary, Unstructured};
25376 let mut buf = [0u8; 1024];
25377 rng.fill_bytes(&mut buf);
25378 let mut unstructured = Unstructured::new(&buf);
25379 Self::arbitrary(&mut unstructured).unwrap_or_default()
25380 }
25381}
25382impl Default for REQUEST_DATA_STREAM_DATA {
25383 fn default() -> Self {
25384 Self::DEFAULT.clone()
25385 }
25386}
25387impl MessageData for REQUEST_DATA_STREAM_DATA {
25388 type Message = MavMessage;
25389 const ID: u32 = 66u32;
25390 const NAME: &'static str = "REQUEST_DATA_STREAM";
25391 const EXTRA_CRC: u8 = 148u8;
25392 const ENCODED_LEN: usize = 6usize;
25393 fn deser(
25394 _version: MavlinkVersion,
25395 __input: &[u8],
25396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25397 let avail_len = __input.len();
25398 let mut payload_buf = [0; Self::ENCODED_LEN];
25399 let mut buf = if avail_len < Self::ENCODED_LEN {
25400 payload_buf[0..avail_len].copy_from_slice(__input);
25401 Bytes::new(&payload_buf)
25402 } else {
25403 Bytes::new(__input)
25404 };
25405 let mut __struct = Self::default();
25406 __struct.req_message_rate = buf.get_u16_le();
25407 __struct.target_system = buf.get_u8();
25408 __struct.target_component = buf.get_u8();
25409 __struct.req_stream_id = buf.get_u8();
25410 __struct.start_stop = buf.get_u8();
25411 Ok(__struct)
25412 }
25413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25414 let mut __tmp = BytesMut::new(bytes);
25415 #[allow(clippy::absurd_extreme_comparisons)]
25416 #[allow(unused_comparisons)]
25417 if __tmp.remaining() < Self::ENCODED_LEN {
25418 panic!(
25419 "buffer is too small (need {} bytes, but got {})",
25420 Self::ENCODED_LEN,
25421 __tmp.remaining(),
25422 )
25423 }
25424 __tmp.put_u16_le(self.req_message_rate);
25425 __tmp.put_u8(self.target_system);
25426 __tmp.put_u8(self.target_component);
25427 __tmp.put_u8(self.req_stream_id);
25428 __tmp.put_u8(self.start_stop);
25429 if matches!(version, MavlinkVersion::V2) {
25430 let len = __tmp.len();
25431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25432 } else {
25433 __tmp.len()
25434 }
25435 }
25436}
25437#[doc = "id: 412"]
25438#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25439#[derive(Debug, Clone, PartialEq)]
25440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25442pub struct REQUEST_EVENT_DATA {
25443 #[doc = "First sequence number of the requested event."]
25444 pub first_sequence: u16,
25445 #[doc = "Last sequence number of the requested event."]
25446 pub last_sequence: u16,
25447 #[doc = "System ID"]
25448 pub target_system: u8,
25449 #[doc = "Component ID"]
25450 pub target_component: u8,
25451}
25452impl REQUEST_EVENT_DATA {
25453 pub const ENCODED_LEN: usize = 6usize;
25454 pub const DEFAULT: Self = Self {
25455 first_sequence: 0_u16,
25456 last_sequence: 0_u16,
25457 target_system: 0_u8,
25458 target_component: 0_u8,
25459 };
25460 #[cfg(feature = "arbitrary")]
25461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25462 use arbitrary::{Arbitrary, Unstructured};
25463 let mut buf = [0u8; 1024];
25464 rng.fill_bytes(&mut buf);
25465 let mut unstructured = Unstructured::new(&buf);
25466 Self::arbitrary(&mut unstructured).unwrap_or_default()
25467 }
25468}
25469impl Default for REQUEST_EVENT_DATA {
25470 fn default() -> Self {
25471 Self::DEFAULT.clone()
25472 }
25473}
25474impl MessageData for REQUEST_EVENT_DATA {
25475 type Message = MavMessage;
25476 const ID: u32 = 412u32;
25477 const NAME: &'static str = "REQUEST_EVENT";
25478 const EXTRA_CRC: u8 = 33u8;
25479 const ENCODED_LEN: usize = 6usize;
25480 fn deser(
25481 _version: MavlinkVersion,
25482 __input: &[u8],
25483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25484 let avail_len = __input.len();
25485 let mut payload_buf = [0; Self::ENCODED_LEN];
25486 let mut buf = if avail_len < Self::ENCODED_LEN {
25487 payload_buf[0..avail_len].copy_from_slice(__input);
25488 Bytes::new(&payload_buf)
25489 } else {
25490 Bytes::new(__input)
25491 };
25492 let mut __struct = Self::default();
25493 __struct.first_sequence = buf.get_u16_le();
25494 __struct.last_sequence = buf.get_u16_le();
25495 __struct.target_system = buf.get_u8();
25496 __struct.target_component = buf.get_u8();
25497 Ok(__struct)
25498 }
25499 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25500 let mut __tmp = BytesMut::new(bytes);
25501 #[allow(clippy::absurd_extreme_comparisons)]
25502 #[allow(unused_comparisons)]
25503 if __tmp.remaining() < Self::ENCODED_LEN {
25504 panic!(
25505 "buffer is too small (need {} bytes, but got {})",
25506 Self::ENCODED_LEN,
25507 __tmp.remaining(),
25508 )
25509 }
25510 __tmp.put_u16_le(self.first_sequence);
25511 __tmp.put_u16_le(self.last_sequence);
25512 __tmp.put_u8(self.target_system);
25513 __tmp.put_u8(self.target_component);
25514 if matches!(version, MavlinkVersion::V2) {
25515 let len = __tmp.len();
25516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25517 } else {
25518 __tmp.len()
25519 }
25520 }
25521}
25522#[doc = "id: 142"]
25523#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25524#[derive(Debug, Clone, PartialEq)]
25525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25527pub struct RESOURCE_REQUEST_DATA {
25528 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25529 pub request_id: u8,
25530 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25531 pub uri_type: u8,
25532 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25533 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25534 pub uri: [u8; 120],
25535 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25536 pub transfer_type: u8,
25537 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25539 pub storage: [u8; 120],
25540}
25541impl RESOURCE_REQUEST_DATA {
25542 pub const ENCODED_LEN: usize = 243usize;
25543 pub const DEFAULT: Self = Self {
25544 request_id: 0_u8,
25545 uri_type: 0_u8,
25546 uri: [0_u8; 120usize],
25547 transfer_type: 0_u8,
25548 storage: [0_u8; 120usize],
25549 };
25550 #[cfg(feature = "arbitrary")]
25551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25552 use arbitrary::{Arbitrary, Unstructured};
25553 let mut buf = [0u8; 1024];
25554 rng.fill_bytes(&mut buf);
25555 let mut unstructured = Unstructured::new(&buf);
25556 Self::arbitrary(&mut unstructured).unwrap_or_default()
25557 }
25558}
25559impl Default for RESOURCE_REQUEST_DATA {
25560 fn default() -> Self {
25561 Self::DEFAULT.clone()
25562 }
25563}
25564impl MessageData for RESOURCE_REQUEST_DATA {
25565 type Message = MavMessage;
25566 const ID: u32 = 142u32;
25567 const NAME: &'static str = "RESOURCE_REQUEST";
25568 const EXTRA_CRC: u8 = 72u8;
25569 const ENCODED_LEN: usize = 243usize;
25570 fn deser(
25571 _version: MavlinkVersion,
25572 __input: &[u8],
25573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25574 let avail_len = __input.len();
25575 let mut payload_buf = [0; Self::ENCODED_LEN];
25576 let mut buf = if avail_len < Self::ENCODED_LEN {
25577 payload_buf[0..avail_len].copy_from_slice(__input);
25578 Bytes::new(&payload_buf)
25579 } else {
25580 Bytes::new(__input)
25581 };
25582 let mut __struct = Self::default();
25583 __struct.request_id = buf.get_u8();
25584 __struct.uri_type = buf.get_u8();
25585 for v in &mut __struct.uri {
25586 let val = buf.get_u8();
25587 *v = val;
25588 }
25589 __struct.transfer_type = buf.get_u8();
25590 for v in &mut __struct.storage {
25591 let val = buf.get_u8();
25592 *v = val;
25593 }
25594 Ok(__struct)
25595 }
25596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25597 let mut __tmp = BytesMut::new(bytes);
25598 #[allow(clippy::absurd_extreme_comparisons)]
25599 #[allow(unused_comparisons)]
25600 if __tmp.remaining() < Self::ENCODED_LEN {
25601 panic!(
25602 "buffer is too small (need {} bytes, but got {})",
25603 Self::ENCODED_LEN,
25604 __tmp.remaining(),
25605 )
25606 }
25607 __tmp.put_u8(self.request_id);
25608 __tmp.put_u8(self.uri_type);
25609 for val in &self.uri {
25610 __tmp.put_u8(*val);
25611 }
25612 __tmp.put_u8(self.transfer_type);
25613 for val in &self.storage {
25614 __tmp.put_u8(*val);
25615 }
25616 if matches!(version, MavlinkVersion::V2) {
25617 let len = __tmp.len();
25618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25619 } else {
25620 __tmp.len()
25621 }
25622 }
25623}
25624#[doc = "id: 413"]
25625#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25626#[derive(Debug, Clone, PartialEq)]
25627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25629pub struct RESPONSE_EVENT_ERROR_DATA {
25630 #[doc = "Sequence number."]
25631 pub sequence: u16,
25632 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25633 pub sequence_oldest_available: u16,
25634 #[doc = "System ID"]
25635 pub target_system: u8,
25636 #[doc = "Component ID"]
25637 pub target_component: u8,
25638 #[doc = "Error reason."]
25639 pub reason: MavEventErrorReason,
25640}
25641impl RESPONSE_EVENT_ERROR_DATA {
25642 pub const ENCODED_LEN: usize = 7usize;
25643 pub const DEFAULT: Self = Self {
25644 sequence: 0_u16,
25645 sequence_oldest_available: 0_u16,
25646 target_system: 0_u8,
25647 target_component: 0_u8,
25648 reason: MavEventErrorReason::DEFAULT,
25649 };
25650 #[cfg(feature = "arbitrary")]
25651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25652 use arbitrary::{Arbitrary, Unstructured};
25653 let mut buf = [0u8; 1024];
25654 rng.fill_bytes(&mut buf);
25655 let mut unstructured = Unstructured::new(&buf);
25656 Self::arbitrary(&mut unstructured).unwrap_or_default()
25657 }
25658}
25659impl Default for RESPONSE_EVENT_ERROR_DATA {
25660 fn default() -> Self {
25661 Self::DEFAULT.clone()
25662 }
25663}
25664impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25665 type Message = MavMessage;
25666 const ID: u32 = 413u32;
25667 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25668 const EXTRA_CRC: u8 = 77u8;
25669 const ENCODED_LEN: usize = 7usize;
25670 fn deser(
25671 _version: MavlinkVersion,
25672 __input: &[u8],
25673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25674 let avail_len = __input.len();
25675 let mut payload_buf = [0; Self::ENCODED_LEN];
25676 let mut buf = if avail_len < Self::ENCODED_LEN {
25677 payload_buf[0..avail_len].copy_from_slice(__input);
25678 Bytes::new(&payload_buf)
25679 } else {
25680 Bytes::new(__input)
25681 };
25682 let mut __struct = Self::default();
25683 __struct.sequence = buf.get_u16_le();
25684 __struct.sequence_oldest_available = buf.get_u16_le();
25685 __struct.target_system = buf.get_u8();
25686 __struct.target_component = buf.get_u8();
25687 let tmp = buf.get_u8();
25688 __struct.reason =
25689 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25690 enum_type: "MavEventErrorReason",
25691 value: tmp as u32,
25692 })?;
25693 Ok(__struct)
25694 }
25695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25696 let mut __tmp = BytesMut::new(bytes);
25697 #[allow(clippy::absurd_extreme_comparisons)]
25698 #[allow(unused_comparisons)]
25699 if __tmp.remaining() < Self::ENCODED_LEN {
25700 panic!(
25701 "buffer is too small (need {} bytes, but got {})",
25702 Self::ENCODED_LEN,
25703 __tmp.remaining(),
25704 )
25705 }
25706 __tmp.put_u16_le(self.sequence);
25707 __tmp.put_u16_le(self.sequence_oldest_available);
25708 __tmp.put_u8(self.target_system);
25709 __tmp.put_u8(self.target_component);
25710 __tmp.put_u8(self.reason as u8);
25711 if matches!(version, MavlinkVersion::V2) {
25712 let len = __tmp.len();
25713 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25714 } else {
25715 __tmp.len()
25716 }
25717 }
25718}
25719#[doc = "id: 55"]
25720#[doc = "Read out the safety zone the MAV currently assumes."]
25721#[derive(Debug, Clone, PartialEq)]
25722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25724pub struct SAFETY_ALLOWED_AREA_DATA {
25725 #[doc = "x position 1 / Latitude 1"]
25726 pub p1x: f32,
25727 #[doc = "y position 1 / Longitude 1"]
25728 pub p1y: f32,
25729 #[doc = "z position 1 / Altitude 1"]
25730 pub p1z: f32,
25731 #[doc = "x position 2 / Latitude 2"]
25732 pub p2x: f32,
25733 #[doc = "y position 2 / Longitude 2"]
25734 pub p2y: f32,
25735 #[doc = "z position 2 / Altitude 2"]
25736 pub p2z: f32,
25737 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25738 pub frame: MavFrame,
25739}
25740impl SAFETY_ALLOWED_AREA_DATA {
25741 pub const ENCODED_LEN: usize = 25usize;
25742 pub const DEFAULT: Self = Self {
25743 p1x: 0.0_f32,
25744 p1y: 0.0_f32,
25745 p1z: 0.0_f32,
25746 p2x: 0.0_f32,
25747 p2y: 0.0_f32,
25748 p2z: 0.0_f32,
25749 frame: MavFrame::DEFAULT,
25750 };
25751 #[cfg(feature = "arbitrary")]
25752 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25753 use arbitrary::{Arbitrary, Unstructured};
25754 let mut buf = [0u8; 1024];
25755 rng.fill_bytes(&mut buf);
25756 let mut unstructured = Unstructured::new(&buf);
25757 Self::arbitrary(&mut unstructured).unwrap_or_default()
25758 }
25759}
25760impl Default for SAFETY_ALLOWED_AREA_DATA {
25761 fn default() -> Self {
25762 Self::DEFAULT.clone()
25763 }
25764}
25765impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25766 type Message = MavMessage;
25767 const ID: u32 = 55u32;
25768 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25769 const EXTRA_CRC: u8 = 3u8;
25770 const ENCODED_LEN: usize = 25usize;
25771 fn deser(
25772 _version: MavlinkVersion,
25773 __input: &[u8],
25774 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25775 let avail_len = __input.len();
25776 let mut payload_buf = [0; Self::ENCODED_LEN];
25777 let mut buf = if avail_len < Self::ENCODED_LEN {
25778 payload_buf[0..avail_len].copy_from_slice(__input);
25779 Bytes::new(&payload_buf)
25780 } else {
25781 Bytes::new(__input)
25782 };
25783 let mut __struct = Self::default();
25784 __struct.p1x = buf.get_f32_le();
25785 __struct.p1y = buf.get_f32_le();
25786 __struct.p1z = buf.get_f32_le();
25787 __struct.p2x = buf.get_f32_le();
25788 __struct.p2y = buf.get_f32_le();
25789 __struct.p2z = buf.get_f32_le();
25790 let tmp = buf.get_u8();
25791 __struct.frame =
25792 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25793 enum_type: "MavFrame",
25794 value: tmp as u32,
25795 })?;
25796 Ok(__struct)
25797 }
25798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25799 let mut __tmp = BytesMut::new(bytes);
25800 #[allow(clippy::absurd_extreme_comparisons)]
25801 #[allow(unused_comparisons)]
25802 if __tmp.remaining() < Self::ENCODED_LEN {
25803 panic!(
25804 "buffer is too small (need {} bytes, but got {})",
25805 Self::ENCODED_LEN,
25806 __tmp.remaining(),
25807 )
25808 }
25809 __tmp.put_f32_le(self.p1x);
25810 __tmp.put_f32_le(self.p1y);
25811 __tmp.put_f32_le(self.p1z);
25812 __tmp.put_f32_le(self.p2x);
25813 __tmp.put_f32_le(self.p2y);
25814 __tmp.put_f32_le(self.p2z);
25815 __tmp.put_u8(self.frame as u8);
25816 if matches!(version, MavlinkVersion::V2) {
25817 let len = __tmp.len();
25818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25819 } else {
25820 __tmp.len()
25821 }
25822 }
25823}
25824#[doc = "id: 54"]
25825#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25826#[derive(Debug, Clone, PartialEq)]
25827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25829pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25830 #[doc = "x position 1 / Latitude 1"]
25831 pub p1x: f32,
25832 #[doc = "y position 1 / Longitude 1"]
25833 pub p1y: f32,
25834 #[doc = "z position 1 / Altitude 1"]
25835 pub p1z: f32,
25836 #[doc = "x position 2 / Latitude 2"]
25837 pub p2x: f32,
25838 #[doc = "y position 2 / Longitude 2"]
25839 pub p2y: f32,
25840 #[doc = "z position 2 / Altitude 2"]
25841 pub p2z: f32,
25842 #[doc = "System ID"]
25843 pub target_system: u8,
25844 #[doc = "Component ID"]
25845 pub target_component: u8,
25846 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25847 pub frame: MavFrame,
25848}
25849impl SAFETY_SET_ALLOWED_AREA_DATA {
25850 pub const ENCODED_LEN: usize = 27usize;
25851 pub const DEFAULT: Self = Self {
25852 p1x: 0.0_f32,
25853 p1y: 0.0_f32,
25854 p1z: 0.0_f32,
25855 p2x: 0.0_f32,
25856 p2y: 0.0_f32,
25857 p2z: 0.0_f32,
25858 target_system: 0_u8,
25859 target_component: 0_u8,
25860 frame: MavFrame::DEFAULT,
25861 };
25862 #[cfg(feature = "arbitrary")]
25863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25864 use arbitrary::{Arbitrary, Unstructured};
25865 let mut buf = [0u8; 1024];
25866 rng.fill_bytes(&mut buf);
25867 let mut unstructured = Unstructured::new(&buf);
25868 Self::arbitrary(&mut unstructured).unwrap_or_default()
25869 }
25870}
25871impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25872 fn default() -> Self {
25873 Self::DEFAULT.clone()
25874 }
25875}
25876impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25877 type Message = MavMessage;
25878 const ID: u32 = 54u32;
25879 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25880 const EXTRA_CRC: u8 = 15u8;
25881 const ENCODED_LEN: usize = 27usize;
25882 fn deser(
25883 _version: MavlinkVersion,
25884 __input: &[u8],
25885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25886 let avail_len = __input.len();
25887 let mut payload_buf = [0; Self::ENCODED_LEN];
25888 let mut buf = if avail_len < Self::ENCODED_LEN {
25889 payload_buf[0..avail_len].copy_from_slice(__input);
25890 Bytes::new(&payload_buf)
25891 } else {
25892 Bytes::new(__input)
25893 };
25894 let mut __struct = Self::default();
25895 __struct.p1x = buf.get_f32_le();
25896 __struct.p1y = buf.get_f32_le();
25897 __struct.p1z = buf.get_f32_le();
25898 __struct.p2x = buf.get_f32_le();
25899 __struct.p2y = buf.get_f32_le();
25900 __struct.p2z = buf.get_f32_le();
25901 __struct.target_system = buf.get_u8();
25902 __struct.target_component = buf.get_u8();
25903 let tmp = buf.get_u8();
25904 __struct.frame =
25905 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25906 enum_type: "MavFrame",
25907 value: tmp as u32,
25908 })?;
25909 Ok(__struct)
25910 }
25911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25912 let mut __tmp = BytesMut::new(bytes);
25913 #[allow(clippy::absurd_extreme_comparisons)]
25914 #[allow(unused_comparisons)]
25915 if __tmp.remaining() < Self::ENCODED_LEN {
25916 panic!(
25917 "buffer is too small (need {} bytes, but got {})",
25918 Self::ENCODED_LEN,
25919 __tmp.remaining(),
25920 )
25921 }
25922 __tmp.put_f32_le(self.p1x);
25923 __tmp.put_f32_le(self.p1y);
25924 __tmp.put_f32_le(self.p1z);
25925 __tmp.put_f32_le(self.p2x);
25926 __tmp.put_f32_le(self.p2y);
25927 __tmp.put_f32_le(self.p2z);
25928 __tmp.put_u8(self.target_system);
25929 __tmp.put_u8(self.target_component);
25930 __tmp.put_u8(self.frame as u8);
25931 if matches!(version, MavlinkVersion::V2) {
25932 let len = __tmp.len();
25933 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25934 } else {
25935 __tmp.len()
25936 }
25937 }
25938}
25939#[doc = "id: 26"]
25940#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25941#[derive(Debug, Clone, PartialEq)]
25942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25944pub struct SCALED_IMU_DATA {
25945 #[doc = "Timestamp (time since system boot)."]
25946 pub time_boot_ms: u32,
25947 #[doc = "X acceleration"]
25948 pub xacc: i16,
25949 #[doc = "Y acceleration"]
25950 pub yacc: i16,
25951 #[doc = "Z acceleration"]
25952 pub zacc: i16,
25953 #[doc = "Angular speed around X axis"]
25954 pub xgyro: i16,
25955 #[doc = "Angular speed around Y axis"]
25956 pub ygyro: i16,
25957 #[doc = "Angular speed around Z axis"]
25958 pub zgyro: i16,
25959 #[doc = "X Magnetic field"]
25960 pub xmag: i16,
25961 #[doc = "Y Magnetic field"]
25962 pub ymag: i16,
25963 #[doc = "Z Magnetic field"]
25964 pub zmag: i16,
25965 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25966 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25967 pub temperature: i16,
25968}
25969impl SCALED_IMU_DATA {
25970 pub const ENCODED_LEN: usize = 24usize;
25971 pub const DEFAULT: Self = Self {
25972 time_boot_ms: 0_u32,
25973 xacc: 0_i16,
25974 yacc: 0_i16,
25975 zacc: 0_i16,
25976 xgyro: 0_i16,
25977 ygyro: 0_i16,
25978 zgyro: 0_i16,
25979 xmag: 0_i16,
25980 ymag: 0_i16,
25981 zmag: 0_i16,
25982 temperature: 0_i16,
25983 };
25984 #[cfg(feature = "arbitrary")]
25985 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25986 use arbitrary::{Arbitrary, Unstructured};
25987 let mut buf = [0u8; 1024];
25988 rng.fill_bytes(&mut buf);
25989 let mut unstructured = Unstructured::new(&buf);
25990 Self::arbitrary(&mut unstructured).unwrap_or_default()
25991 }
25992}
25993impl Default for SCALED_IMU_DATA {
25994 fn default() -> Self {
25995 Self::DEFAULT.clone()
25996 }
25997}
25998impl MessageData for SCALED_IMU_DATA {
25999 type Message = MavMessage;
26000 const ID: u32 = 26u32;
26001 const NAME: &'static str = "SCALED_IMU";
26002 const EXTRA_CRC: u8 = 170u8;
26003 const ENCODED_LEN: usize = 24usize;
26004 fn deser(
26005 _version: MavlinkVersion,
26006 __input: &[u8],
26007 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26008 let avail_len = __input.len();
26009 let mut payload_buf = [0; Self::ENCODED_LEN];
26010 let mut buf = if avail_len < Self::ENCODED_LEN {
26011 payload_buf[0..avail_len].copy_from_slice(__input);
26012 Bytes::new(&payload_buf)
26013 } else {
26014 Bytes::new(__input)
26015 };
26016 let mut __struct = Self::default();
26017 __struct.time_boot_ms = buf.get_u32_le();
26018 __struct.xacc = buf.get_i16_le();
26019 __struct.yacc = buf.get_i16_le();
26020 __struct.zacc = buf.get_i16_le();
26021 __struct.xgyro = buf.get_i16_le();
26022 __struct.ygyro = buf.get_i16_le();
26023 __struct.zgyro = buf.get_i16_le();
26024 __struct.xmag = buf.get_i16_le();
26025 __struct.ymag = buf.get_i16_le();
26026 __struct.zmag = buf.get_i16_le();
26027 __struct.temperature = buf.get_i16_le();
26028 Ok(__struct)
26029 }
26030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26031 let mut __tmp = BytesMut::new(bytes);
26032 #[allow(clippy::absurd_extreme_comparisons)]
26033 #[allow(unused_comparisons)]
26034 if __tmp.remaining() < Self::ENCODED_LEN {
26035 panic!(
26036 "buffer is too small (need {} bytes, but got {})",
26037 Self::ENCODED_LEN,
26038 __tmp.remaining(),
26039 )
26040 }
26041 __tmp.put_u32_le(self.time_boot_ms);
26042 __tmp.put_i16_le(self.xacc);
26043 __tmp.put_i16_le(self.yacc);
26044 __tmp.put_i16_le(self.zacc);
26045 __tmp.put_i16_le(self.xgyro);
26046 __tmp.put_i16_le(self.ygyro);
26047 __tmp.put_i16_le(self.zgyro);
26048 __tmp.put_i16_le(self.xmag);
26049 __tmp.put_i16_le(self.ymag);
26050 __tmp.put_i16_le(self.zmag);
26051 __tmp.put_i16_le(self.temperature);
26052 if matches!(version, MavlinkVersion::V2) {
26053 let len = __tmp.len();
26054 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26055 } else {
26056 __tmp.len()
26057 }
26058 }
26059}
26060#[doc = "id: 116"]
26061#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26062#[derive(Debug, Clone, PartialEq)]
26063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26065pub struct SCALED_IMU2_DATA {
26066 #[doc = "Timestamp (time since system boot)."]
26067 pub time_boot_ms: u32,
26068 #[doc = "X acceleration"]
26069 pub xacc: i16,
26070 #[doc = "Y acceleration"]
26071 pub yacc: i16,
26072 #[doc = "Z acceleration"]
26073 pub zacc: i16,
26074 #[doc = "Angular speed around X axis"]
26075 pub xgyro: i16,
26076 #[doc = "Angular speed around Y axis"]
26077 pub ygyro: i16,
26078 #[doc = "Angular speed around Z axis"]
26079 pub zgyro: i16,
26080 #[doc = "X Magnetic field"]
26081 pub xmag: i16,
26082 #[doc = "Y Magnetic field"]
26083 pub ymag: i16,
26084 #[doc = "Z Magnetic field"]
26085 pub zmag: i16,
26086 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26087 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26088 pub temperature: i16,
26089}
26090impl SCALED_IMU2_DATA {
26091 pub const ENCODED_LEN: usize = 24usize;
26092 pub const DEFAULT: Self = Self {
26093 time_boot_ms: 0_u32,
26094 xacc: 0_i16,
26095 yacc: 0_i16,
26096 zacc: 0_i16,
26097 xgyro: 0_i16,
26098 ygyro: 0_i16,
26099 zgyro: 0_i16,
26100 xmag: 0_i16,
26101 ymag: 0_i16,
26102 zmag: 0_i16,
26103 temperature: 0_i16,
26104 };
26105 #[cfg(feature = "arbitrary")]
26106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26107 use arbitrary::{Arbitrary, Unstructured};
26108 let mut buf = [0u8; 1024];
26109 rng.fill_bytes(&mut buf);
26110 let mut unstructured = Unstructured::new(&buf);
26111 Self::arbitrary(&mut unstructured).unwrap_or_default()
26112 }
26113}
26114impl Default for SCALED_IMU2_DATA {
26115 fn default() -> Self {
26116 Self::DEFAULT.clone()
26117 }
26118}
26119impl MessageData for SCALED_IMU2_DATA {
26120 type Message = MavMessage;
26121 const ID: u32 = 116u32;
26122 const NAME: &'static str = "SCALED_IMU2";
26123 const EXTRA_CRC: u8 = 76u8;
26124 const ENCODED_LEN: usize = 24usize;
26125 fn deser(
26126 _version: MavlinkVersion,
26127 __input: &[u8],
26128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26129 let avail_len = __input.len();
26130 let mut payload_buf = [0; Self::ENCODED_LEN];
26131 let mut buf = if avail_len < Self::ENCODED_LEN {
26132 payload_buf[0..avail_len].copy_from_slice(__input);
26133 Bytes::new(&payload_buf)
26134 } else {
26135 Bytes::new(__input)
26136 };
26137 let mut __struct = Self::default();
26138 __struct.time_boot_ms = buf.get_u32_le();
26139 __struct.xacc = buf.get_i16_le();
26140 __struct.yacc = buf.get_i16_le();
26141 __struct.zacc = buf.get_i16_le();
26142 __struct.xgyro = buf.get_i16_le();
26143 __struct.ygyro = buf.get_i16_le();
26144 __struct.zgyro = buf.get_i16_le();
26145 __struct.xmag = buf.get_i16_le();
26146 __struct.ymag = buf.get_i16_le();
26147 __struct.zmag = buf.get_i16_le();
26148 __struct.temperature = buf.get_i16_le();
26149 Ok(__struct)
26150 }
26151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26152 let mut __tmp = BytesMut::new(bytes);
26153 #[allow(clippy::absurd_extreme_comparisons)]
26154 #[allow(unused_comparisons)]
26155 if __tmp.remaining() < Self::ENCODED_LEN {
26156 panic!(
26157 "buffer is too small (need {} bytes, but got {})",
26158 Self::ENCODED_LEN,
26159 __tmp.remaining(),
26160 )
26161 }
26162 __tmp.put_u32_le(self.time_boot_ms);
26163 __tmp.put_i16_le(self.xacc);
26164 __tmp.put_i16_le(self.yacc);
26165 __tmp.put_i16_le(self.zacc);
26166 __tmp.put_i16_le(self.xgyro);
26167 __tmp.put_i16_le(self.ygyro);
26168 __tmp.put_i16_le(self.zgyro);
26169 __tmp.put_i16_le(self.xmag);
26170 __tmp.put_i16_le(self.ymag);
26171 __tmp.put_i16_le(self.zmag);
26172 __tmp.put_i16_le(self.temperature);
26173 if matches!(version, MavlinkVersion::V2) {
26174 let len = __tmp.len();
26175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26176 } else {
26177 __tmp.len()
26178 }
26179 }
26180}
26181#[doc = "id: 129"]
26182#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26183#[derive(Debug, Clone, PartialEq)]
26184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26186pub struct SCALED_IMU3_DATA {
26187 #[doc = "Timestamp (time since system boot)."]
26188 pub time_boot_ms: u32,
26189 #[doc = "X acceleration"]
26190 pub xacc: i16,
26191 #[doc = "Y acceleration"]
26192 pub yacc: i16,
26193 #[doc = "Z acceleration"]
26194 pub zacc: i16,
26195 #[doc = "Angular speed around X axis"]
26196 pub xgyro: i16,
26197 #[doc = "Angular speed around Y axis"]
26198 pub ygyro: i16,
26199 #[doc = "Angular speed around Z axis"]
26200 pub zgyro: i16,
26201 #[doc = "X Magnetic field"]
26202 pub xmag: i16,
26203 #[doc = "Y Magnetic field"]
26204 pub ymag: i16,
26205 #[doc = "Z Magnetic field"]
26206 pub zmag: i16,
26207 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26208 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26209 pub temperature: i16,
26210}
26211impl SCALED_IMU3_DATA {
26212 pub const ENCODED_LEN: usize = 24usize;
26213 pub const DEFAULT: Self = Self {
26214 time_boot_ms: 0_u32,
26215 xacc: 0_i16,
26216 yacc: 0_i16,
26217 zacc: 0_i16,
26218 xgyro: 0_i16,
26219 ygyro: 0_i16,
26220 zgyro: 0_i16,
26221 xmag: 0_i16,
26222 ymag: 0_i16,
26223 zmag: 0_i16,
26224 temperature: 0_i16,
26225 };
26226 #[cfg(feature = "arbitrary")]
26227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26228 use arbitrary::{Arbitrary, Unstructured};
26229 let mut buf = [0u8; 1024];
26230 rng.fill_bytes(&mut buf);
26231 let mut unstructured = Unstructured::new(&buf);
26232 Self::arbitrary(&mut unstructured).unwrap_or_default()
26233 }
26234}
26235impl Default for SCALED_IMU3_DATA {
26236 fn default() -> Self {
26237 Self::DEFAULT.clone()
26238 }
26239}
26240impl MessageData for SCALED_IMU3_DATA {
26241 type Message = MavMessage;
26242 const ID: u32 = 129u32;
26243 const NAME: &'static str = "SCALED_IMU3";
26244 const EXTRA_CRC: u8 = 46u8;
26245 const ENCODED_LEN: usize = 24usize;
26246 fn deser(
26247 _version: MavlinkVersion,
26248 __input: &[u8],
26249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26250 let avail_len = __input.len();
26251 let mut payload_buf = [0; Self::ENCODED_LEN];
26252 let mut buf = if avail_len < Self::ENCODED_LEN {
26253 payload_buf[0..avail_len].copy_from_slice(__input);
26254 Bytes::new(&payload_buf)
26255 } else {
26256 Bytes::new(__input)
26257 };
26258 let mut __struct = Self::default();
26259 __struct.time_boot_ms = buf.get_u32_le();
26260 __struct.xacc = buf.get_i16_le();
26261 __struct.yacc = buf.get_i16_le();
26262 __struct.zacc = buf.get_i16_le();
26263 __struct.xgyro = buf.get_i16_le();
26264 __struct.ygyro = buf.get_i16_le();
26265 __struct.zgyro = buf.get_i16_le();
26266 __struct.xmag = buf.get_i16_le();
26267 __struct.ymag = buf.get_i16_le();
26268 __struct.zmag = buf.get_i16_le();
26269 __struct.temperature = buf.get_i16_le();
26270 Ok(__struct)
26271 }
26272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26273 let mut __tmp = BytesMut::new(bytes);
26274 #[allow(clippy::absurd_extreme_comparisons)]
26275 #[allow(unused_comparisons)]
26276 if __tmp.remaining() < Self::ENCODED_LEN {
26277 panic!(
26278 "buffer is too small (need {} bytes, but got {})",
26279 Self::ENCODED_LEN,
26280 __tmp.remaining(),
26281 )
26282 }
26283 __tmp.put_u32_le(self.time_boot_ms);
26284 __tmp.put_i16_le(self.xacc);
26285 __tmp.put_i16_le(self.yacc);
26286 __tmp.put_i16_le(self.zacc);
26287 __tmp.put_i16_le(self.xgyro);
26288 __tmp.put_i16_le(self.ygyro);
26289 __tmp.put_i16_le(self.zgyro);
26290 __tmp.put_i16_le(self.xmag);
26291 __tmp.put_i16_le(self.ymag);
26292 __tmp.put_i16_le(self.zmag);
26293 __tmp.put_i16_le(self.temperature);
26294 if matches!(version, MavlinkVersion::V2) {
26295 let len = __tmp.len();
26296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26297 } else {
26298 __tmp.len()
26299 }
26300 }
26301}
26302#[doc = "id: 29"]
26303#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26304#[derive(Debug, Clone, PartialEq)]
26305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26307pub struct SCALED_PRESSURE_DATA {
26308 #[doc = "Timestamp (time since system boot)."]
26309 pub time_boot_ms: u32,
26310 #[doc = "Absolute pressure"]
26311 pub press_abs: f32,
26312 #[doc = "Differential pressure 1"]
26313 pub press_diff: f32,
26314 #[doc = "Absolute pressure temperature"]
26315 pub temperature: i16,
26316 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26317 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26318 pub temperature_press_diff: i16,
26319}
26320impl SCALED_PRESSURE_DATA {
26321 pub const ENCODED_LEN: usize = 16usize;
26322 pub const DEFAULT: Self = Self {
26323 time_boot_ms: 0_u32,
26324 press_abs: 0.0_f32,
26325 press_diff: 0.0_f32,
26326 temperature: 0_i16,
26327 temperature_press_diff: 0_i16,
26328 };
26329 #[cfg(feature = "arbitrary")]
26330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26331 use arbitrary::{Arbitrary, Unstructured};
26332 let mut buf = [0u8; 1024];
26333 rng.fill_bytes(&mut buf);
26334 let mut unstructured = Unstructured::new(&buf);
26335 Self::arbitrary(&mut unstructured).unwrap_or_default()
26336 }
26337}
26338impl Default for SCALED_PRESSURE_DATA {
26339 fn default() -> Self {
26340 Self::DEFAULT.clone()
26341 }
26342}
26343impl MessageData for SCALED_PRESSURE_DATA {
26344 type Message = MavMessage;
26345 const ID: u32 = 29u32;
26346 const NAME: &'static str = "SCALED_PRESSURE";
26347 const EXTRA_CRC: u8 = 115u8;
26348 const ENCODED_LEN: usize = 16usize;
26349 fn deser(
26350 _version: MavlinkVersion,
26351 __input: &[u8],
26352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26353 let avail_len = __input.len();
26354 let mut payload_buf = [0; Self::ENCODED_LEN];
26355 let mut buf = if avail_len < Self::ENCODED_LEN {
26356 payload_buf[0..avail_len].copy_from_slice(__input);
26357 Bytes::new(&payload_buf)
26358 } else {
26359 Bytes::new(__input)
26360 };
26361 let mut __struct = Self::default();
26362 __struct.time_boot_ms = buf.get_u32_le();
26363 __struct.press_abs = buf.get_f32_le();
26364 __struct.press_diff = buf.get_f32_le();
26365 __struct.temperature = buf.get_i16_le();
26366 __struct.temperature_press_diff = buf.get_i16_le();
26367 Ok(__struct)
26368 }
26369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26370 let mut __tmp = BytesMut::new(bytes);
26371 #[allow(clippy::absurd_extreme_comparisons)]
26372 #[allow(unused_comparisons)]
26373 if __tmp.remaining() < Self::ENCODED_LEN {
26374 panic!(
26375 "buffer is too small (need {} bytes, but got {})",
26376 Self::ENCODED_LEN,
26377 __tmp.remaining(),
26378 )
26379 }
26380 __tmp.put_u32_le(self.time_boot_ms);
26381 __tmp.put_f32_le(self.press_abs);
26382 __tmp.put_f32_le(self.press_diff);
26383 __tmp.put_i16_le(self.temperature);
26384 __tmp.put_i16_le(self.temperature_press_diff);
26385 if matches!(version, MavlinkVersion::V2) {
26386 let len = __tmp.len();
26387 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26388 } else {
26389 __tmp.len()
26390 }
26391 }
26392}
26393#[doc = "id: 137"]
26394#[doc = "Barometer readings for 2nd barometer."]
26395#[derive(Debug, Clone, PartialEq)]
26396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26398pub struct SCALED_PRESSURE2_DATA {
26399 #[doc = "Timestamp (time since system boot)."]
26400 pub time_boot_ms: u32,
26401 #[doc = "Absolute pressure"]
26402 pub press_abs: f32,
26403 #[doc = "Differential pressure"]
26404 pub press_diff: f32,
26405 #[doc = "Absolute pressure temperature"]
26406 pub temperature: i16,
26407 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26408 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26409 pub temperature_press_diff: i16,
26410}
26411impl SCALED_PRESSURE2_DATA {
26412 pub const ENCODED_LEN: usize = 16usize;
26413 pub const DEFAULT: Self = Self {
26414 time_boot_ms: 0_u32,
26415 press_abs: 0.0_f32,
26416 press_diff: 0.0_f32,
26417 temperature: 0_i16,
26418 temperature_press_diff: 0_i16,
26419 };
26420 #[cfg(feature = "arbitrary")]
26421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26422 use arbitrary::{Arbitrary, Unstructured};
26423 let mut buf = [0u8; 1024];
26424 rng.fill_bytes(&mut buf);
26425 let mut unstructured = Unstructured::new(&buf);
26426 Self::arbitrary(&mut unstructured).unwrap_or_default()
26427 }
26428}
26429impl Default for SCALED_PRESSURE2_DATA {
26430 fn default() -> Self {
26431 Self::DEFAULT.clone()
26432 }
26433}
26434impl MessageData for SCALED_PRESSURE2_DATA {
26435 type Message = MavMessage;
26436 const ID: u32 = 137u32;
26437 const NAME: &'static str = "SCALED_PRESSURE2";
26438 const EXTRA_CRC: u8 = 195u8;
26439 const ENCODED_LEN: usize = 16usize;
26440 fn deser(
26441 _version: MavlinkVersion,
26442 __input: &[u8],
26443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26444 let avail_len = __input.len();
26445 let mut payload_buf = [0; Self::ENCODED_LEN];
26446 let mut buf = if avail_len < Self::ENCODED_LEN {
26447 payload_buf[0..avail_len].copy_from_slice(__input);
26448 Bytes::new(&payload_buf)
26449 } else {
26450 Bytes::new(__input)
26451 };
26452 let mut __struct = Self::default();
26453 __struct.time_boot_ms = buf.get_u32_le();
26454 __struct.press_abs = buf.get_f32_le();
26455 __struct.press_diff = buf.get_f32_le();
26456 __struct.temperature = buf.get_i16_le();
26457 __struct.temperature_press_diff = buf.get_i16_le();
26458 Ok(__struct)
26459 }
26460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26461 let mut __tmp = BytesMut::new(bytes);
26462 #[allow(clippy::absurd_extreme_comparisons)]
26463 #[allow(unused_comparisons)]
26464 if __tmp.remaining() < Self::ENCODED_LEN {
26465 panic!(
26466 "buffer is too small (need {} bytes, but got {})",
26467 Self::ENCODED_LEN,
26468 __tmp.remaining(),
26469 )
26470 }
26471 __tmp.put_u32_le(self.time_boot_ms);
26472 __tmp.put_f32_le(self.press_abs);
26473 __tmp.put_f32_le(self.press_diff);
26474 __tmp.put_i16_le(self.temperature);
26475 __tmp.put_i16_le(self.temperature_press_diff);
26476 if matches!(version, MavlinkVersion::V2) {
26477 let len = __tmp.len();
26478 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26479 } else {
26480 __tmp.len()
26481 }
26482 }
26483}
26484#[doc = "id: 143"]
26485#[doc = "Barometer readings for 3rd barometer."]
26486#[derive(Debug, Clone, PartialEq)]
26487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26489pub struct SCALED_PRESSURE3_DATA {
26490 #[doc = "Timestamp (time since system boot)."]
26491 pub time_boot_ms: u32,
26492 #[doc = "Absolute pressure"]
26493 pub press_abs: f32,
26494 #[doc = "Differential pressure"]
26495 pub press_diff: f32,
26496 #[doc = "Absolute pressure temperature"]
26497 pub temperature: i16,
26498 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26499 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26500 pub temperature_press_diff: i16,
26501}
26502impl SCALED_PRESSURE3_DATA {
26503 pub const ENCODED_LEN: usize = 16usize;
26504 pub const DEFAULT: Self = Self {
26505 time_boot_ms: 0_u32,
26506 press_abs: 0.0_f32,
26507 press_diff: 0.0_f32,
26508 temperature: 0_i16,
26509 temperature_press_diff: 0_i16,
26510 };
26511 #[cfg(feature = "arbitrary")]
26512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26513 use arbitrary::{Arbitrary, Unstructured};
26514 let mut buf = [0u8; 1024];
26515 rng.fill_bytes(&mut buf);
26516 let mut unstructured = Unstructured::new(&buf);
26517 Self::arbitrary(&mut unstructured).unwrap_or_default()
26518 }
26519}
26520impl Default for SCALED_PRESSURE3_DATA {
26521 fn default() -> Self {
26522 Self::DEFAULT.clone()
26523 }
26524}
26525impl MessageData for SCALED_PRESSURE3_DATA {
26526 type Message = MavMessage;
26527 const ID: u32 = 143u32;
26528 const NAME: &'static str = "SCALED_PRESSURE3";
26529 const EXTRA_CRC: u8 = 131u8;
26530 const ENCODED_LEN: usize = 16usize;
26531 fn deser(
26532 _version: MavlinkVersion,
26533 __input: &[u8],
26534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26535 let avail_len = __input.len();
26536 let mut payload_buf = [0; Self::ENCODED_LEN];
26537 let mut buf = if avail_len < Self::ENCODED_LEN {
26538 payload_buf[0..avail_len].copy_from_slice(__input);
26539 Bytes::new(&payload_buf)
26540 } else {
26541 Bytes::new(__input)
26542 };
26543 let mut __struct = Self::default();
26544 __struct.time_boot_ms = buf.get_u32_le();
26545 __struct.press_abs = buf.get_f32_le();
26546 __struct.press_diff = buf.get_f32_le();
26547 __struct.temperature = buf.get_i16_le();
26548 __struct.temperature_press_diff = buf.get_i16_le();
26549 Ok(__struct)
26550 }
26551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26552 let mut __tmp = BytesMut::new(bytes);
26553 #[allow(clippy::absurd_extreme_comparisons)]
26554 #[allow(unused_comparisons)]
26555 if __tmp.remaining() < Self::ENCODED_LEN {
26556 panic!(
26557 "buffer is too small (need {} bytes, but got {})",
26558 Self::ENCODED_LEN,
26559 __tmp.remaining(),
26560 )
26561 }
26562 __tmp.put_u32_le(self.time_boot_ms);
26563 __tmp.put_f32_le(self.press_abs);
26564 __tmp.put_f32_le(self.press_diff);
26565 __tmp.put_i16_le(self.temperature);
26566 __tmp.put_i16_le(self.temperature_press_diff);
26567 if matches!(version, MavlinkVersion::V2) {
26568 let len = __tmp.len();
26569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26570 } else {
26571 __tmp.len()
26572 }
26573 }
26574}
26575#[doc = "id: 126"]
26576#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26577#[derive(Debug, Clone, PartialEq)]
26578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26580pub struct SERIAL_CONTROL_DATA {
26581 #[doc = "Baudrate of transfer. Zero means no change."]
26582 pub baudrate: u32,
26583 #[doc = "Timeout for reply data"]
26584 pub timeout: u16,
26585 #[doc = "Serial control device type."]
26586 pub device: SerialControlDev,
26587 #[doc = "Bitmap of serial control flags."]
26588 pub flags: SerialControlFlag,
26589 #[doc = "how many bytes in this transfer"]
26590 pub count: u8,
26591 #[doc = "serial data"]
26592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26593 pub data: [u8; 70],
26594 #[doc = "System ID"]
26595 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26596 pub target_system: u8,
26597 #[doc = "Component ID"]
26598 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26599 pub target_component: u8,
26600}
26601impl SERIAL_CONTROL_DATA {
26602 pub const ENCODED_LEN: usize = 81usize;
26603 pub const DEFAULT: Self = Self {
26604 baudrate: 0_u32,
26605 timeout: 0_u16,
26606 device: SerialControlDev::DEFAULT,
26607 flags: SerialControlFlag::DEFAULT,
26608 count: 0_u8,
26609 data: [0_u8; 70usize],
26610 target_system: 0_u8,
26611 target_component: 0_u8,
26612 };
26613 #[cfg(feature = "arbitrary")]
26614 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26615 use arbitrary::{Arbitrary, Unstructured};
26616 let mut buf = [0u8; 1024];
26617 rng.fill_bytes(&mut buf);
26618 let mut unstructured = Unstructured::new(&buf);
26619 Self::arbitrary(&mut unstructured).unwrap_or_default()
26620 }
26621}
26622impl Default for SERIAL_CONTROL_DATA {
26623 fn default() -> Self {
26624 Self::DEFAULT.clone()
26625 }
26626}
26627impl MessageData for SERIAL_CONTROL_DATA {
26628 type Message = MavMessage;
26629 const ID: u32 = 126u32;
26630 const NAME: &'static str = "SERIAL_CONTROL";
26631 const EXTRA_CRC: u8 = 220u8;
26632 const ENCODED_LEN: usize = 81usize;
26633 fn deser(
26634 _version: MavlinkVersion,
26635 __input: &[u8],
26636 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26637 let avail_len = __input.len();
26638 let mut payload_buf = [0; Self::ENCODED_LEN];
26639 let mut buf = if avail_len < Self::ENCODED_LEN {
26640 payload_buf[0..avail_len].copy_from_slice(__input);
26641 Bytes::new(&payload_buf)
26642 } else {
26643 Bytes::new(__input)
26644 };
26645 let mut __struct = Self::default();
26646 __struct.baudrate = buf.get_u32_le();
26647 __struct.timeout = buf.get_u16_le();
26648 let tmp = buf.get_u8();
26649 __struct.device =
26650 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26651 enum_type: "SerialControlDev",
26652 value: tmp as u32,
26653 })?;
26654 let tmp = buf.get_u8();
26655 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26656 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26657 flag_type: "SerialControlFlag",
26658 value: tmp as u32,
26659 })?;
26660 __struct.count = buf.get_u8();
26661 for v in &mut __struct.data {
26662 let val = buf.get_u8();
26663 *v = val;
26664 }
26665 __struct.target_system = buf.get_u8();
26666 __struct.target_component = buf.get_u8();
26667 Ok(__struct)
26668 }
26669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26670 let mut __tmp = BytesMut::new(bytes);
26671 #[allow(clippy::absurd_extreme_comparisons)]
26672 #[allow(unused_comparisons)]
26673 if __tmp.remaining() < Self::ENCODED_LEN {
26674 panic!(
26675 "buffer is too small (need {} bytes, but got {})",
26676 Self::ENCODED_LEN,
26677 __tmp.remaining(),
26678 )
26679 }
26680 __tmp.put_u32_le(self.baudrate);
26681 __tmp.put_u16_le(self.timeout);
26682 __tmp.put_u8(self.device as u8);
26683 __tmp.put_u8(self.flags.bits());
26684 __tmp.put_u8(self.count);
26685 for val in &self.data {
26686 __tmp.put_u8(*val);
26687 }
26688 __tmp.put_u8(self.target_system);
26689 __tmp.put_u8(self.target_component);
26690 if matches!(version, MavlinkVersion::V2) {
26691 let len = __tmp.len();
26692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26693 } else {
26694 __tmp.len()
26695 }
26696 }
26697}
26698#[doc = "id: 36"]
26699#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26700#[derive(Debug, Clone, PartialEq)]
26701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26703pub struct SERVO_OUTPUT_RAW_DATA {
26704 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26705 pub time_usec: u32,
26706 #[doc = "Servo output 1 value"]
26707 pub servo1_raw: u16,
26708 #[doc = "Servo output 2 value"]
26709 pub servo2_raw: u16,
26710 #[doc = "Servo output 3 value"]
26711 pub servo3_raw: u16,
26712 #[doc = "Servo output 4 value"]
26713 pub servo4_raw: u16,
26714 #[doc = "Servo output 5 value"]
26715 pub servo5_raw: u16,
26716 #[doc = "Servo output 6 value"]
26717 pub servo6_raw: u16,
26718 #[doc = "Servo output 7 value"]
26719 pub servo7_raw: u16,
26720 #[doc = "Servo output 8 value"]
26721 pub servo8_raw: u16,
26722 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26723 pub port: u8,
26724 #[doc = "Servo output 9 value"]
26725 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26726 pub servo9_raw: u16,
26727 #[doc = "Servo output 10 value"]
26728 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26729 pub servo10_raw: u16,
26730 #[doc = "Servo output 11 value"]
26731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26732 pub servo11_raw: u16,
26733 #[doc = "Servo output 12 value"]
26734 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26735 pub servo12_raw: u16,
26736 #[doc = "Servo output 13 value"]
26737 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26738 pub servo13_raw: u16,
26739 #[doc = "Servo output 14 value"]
26740 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26741 pub servo14_raw: u16,
26742 #[doc = "Servo output 15 value"]
26743 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26744 pub servo15_raw: u16,
26745 #[doc = "Servo output 16 value"]
26746 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26747 pub servo16_raw: u16,
26748}
26749impl SERVO_OUTPUT_RAW_DATA {
26750 pub const ENCODED_LEN: usize = 37usize;
26751 pub const DEFAULT: Self = Self {
26752 time_usec: 0_u32,
26753 servo1_raw: 0_u16,
26754 servo2_raw: 0_u16,
26755 servo3_raw: 0_u16,
26756 servo4_raw: 0_u16,
26757 servo5_raw: 0_u16,
26758 servo6_raw: 0_u16,
26759 servo7_raw: 0_u16,
26760 servo8_raw: 0_u16,
26761 port: 0_u8,
26762 servo9_raw: 0_u16,
26763 servo10_raw: 0_u16,
26764 servo11_raw: 0_u16,
26765 servo12_raw: 0_u16,
26766 servo13_raw: 0_u16,
26767 servo14_raw: 0_u16,
26768 servo15_raw: 0_u16,
26769 servo16_raw: 0_u16,
26770 };
26771 #[cfg(feature = "arbitrary")]
26772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26773 use arbitrary::{Arbitrary, Unstructured};
26774 let mut buf = [0u8; 1024];
26775 rng.fill_bytes(&mut buf);
26776 let mut unstructured = Unstructured::new(&buf);
26777 Self::arbitrary(&mut unstructured).unwrap_or_default()
26778 }
26779}
26780impl Default for SERVO_OUTPUT_RAW_DATA {
26781 fn default() -> Self {
26782 Self::DEFAULT.clone()
26783 }
26784}
26785impl MessageData for SERVO_OUTPUT_RAW_DATA {
26786 type Message = MavMessage;
26787 const ID: u32 = 36u32;
26788 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26789 const EXTRA_CRC: u8 = 222u8;
26790 const ENCODED_LEN: usize = 37usize;
26791 fn deser(
26792 _version: MavlinkVersion,
26793 __input: &[u8],
26794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26795 let avail_len = __input.len();
26796 let mut payload_buf = [0; Self::ENCODED_LEN];
26797 let mut buf = if avail_len < Self::ENCODED_LEN {
26798 payload_buf[0..avail_len].copy_from_slice(__input);
26799 Bytes::new(&payload_buf)
26800 } else {
26801 Bytes::new(__input)
26802 };
26803 let mut __struct = Self::default();
26804 __struct.time_usec = buf.get_u32_le();
26805 __struct.servo1_raw = buf.get_u16_le();
26806 __struct.servo2_raw = buf.get_u16_le();
26807 __struct.servo3_raw = buf.get_u16_le();
26808 __struct.servo4_raw = buf.get_u16_le();
26809 __struct.servo5_raw = buf.get_u16_le();
26810 __struct.servo6_raw = buf.get_u16_le();
26811 __struct.servo7_raw = buf.get_u16_le();
26812 __struct.servo8_raw = buf.get_u16_le();
26813 __struct.port = buf.get_u8();
26814 __struct.servo9_raw = buf.get_u16_le();
26815 __struct.servo10_raw = buf.get_u16_le();
26816 __struct.servo11_raw = buf.get_u16_le();
26817 __struct.servo12_raw = buf.get_u16_le();
26818 __struct.servo13_raw = buf.get_u16_le();
26819 __struct.servo14_raw = buf.get_u16_le();
26820 __struct.servo15_raw = buf.get_u16_le();
26821 __struct.servo16_raw = buf.get_u16_le();
26822 Ok(__struct)
26823 }
26824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26825 let mut __tmp = BytesMut::new(bytes);
26826 #[allow(clippy::absurd_extreme_comparisons)]
26827 #[allow(unused_comparisons)]
26828 if __tmp.remaining() < Self::ENCODED_LEN {
26829 panic!(
26830 "buffer is too small (need {} bytes, but got {})",
26831 Self::ENCODED_LEN,
26832 __tmp.remaining(),
26833 )
26834 }
26835 __tmp.put_u32_le(self.time_usec);
26836 __tmp.put_u16_le(self.servo1_raw);
26837 __tmp.put_u16_le(self.servo2_raw);
26838 __tmp.put_u16_le(self.servo3_raw);
26839 __tmp.put_u16_le(self.servo4_raw);
26840 __tmp.put_u16_le(self.servo5_raw);
26841 __tmp.put_u16_le(self.servo6_raw);
26842 __tmp.put_u16_le(self.servo7_raw);
26843 __tmp.put_u16_le(self.servo8_raw);
26844 __tmp.put_u8(self.port);
26845 __tmp.put_u16_le(self.servo9_raw);
26846 __tmp.put_u16_le(self.servo10_raw);
26847 __tmp.put_u16_le(self.servo11_raw);
26848 __tmp.put_u16_le(self.servo12_raw);
26849 __tmp.put_u16_le(self.servo13_raw);
26850 __tmp.put_u16_le(self.servo14_raw);
26851 __tmp.put_u16_le(self.servo15_raw);
26852 __tmp.put_u16_le(self.servo16_raw);
26853 if matches!(version, MavlinkVersion::V2) {
26854 let len = __tmp.len();
26855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26856 } else {
26857 __tmp.len()
26858 }
26859 }
26860}
26861#[doc = "id: 256"]
26862#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26863#[derive(Debug, Clone, PartialEq)]
26864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26866pub struct SETUP_SIGNING_DATA {
26867 #[doc = "initial timestamp"]
26868 pub initial_timestamp: u64,
26869 #[doc = "system id of the target"]
26870 pub target_system: u8,
26871 #[doc = "component ID of the target"]
26872 pub target_component: u8,
26873 #[doc = "signing key"]
26874 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26875 pub secret_key: [u8; 32],
26876}
26877impl SETUP_SIGNING_DATA {
26878 pub const ENCODED_LEN: usize = 42usize;
26879 pub const DEFAULT: Self = Self {
26880 initial_timestamp: 0_u64,
26881 target_system: 0_u8,
26882 target_component: 0_u8,
26883 secret_key: [0_u8; 32usize],
26884 };
26885 #[cfg(feature = "arbitrary")]
26886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26887 use arbitrary::{Arbitrary, Unstructured};
26888 let mut buf = [0u8; 1024];
26889 rng.fill_bytes(&mut buf);
26890 let mut unstructured = Unstructured::new(&buf);
26891 Self::arbitrary(&mut unstructured).unwrap_or_default()
26892 }
26893}
26894impl Default for SETUP_SIGNING_DATA {
26895 fn default() -> Self {
26896 Self::DEFAULT.clone()
26897 }
26898}
26899impl MessageData for SETUP_SIGNING_DATA {
26900 type Message = MavMessage;
26901 const ID: u32 = 256u32;
26902 const NAME: &'static str = "SETUP_SIGNING";
26903 const EXTRA_CRC: u8 = 71u8;
26904 const ENCODED_LEN: usize = 42usize;
26905 fn deser(
26906 _version: MavlinkVersion,
26907 __input: &[u8],
26908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26909 let avail_len = __input.len();
26910 let mut payload_buf = [0; Self::ENCODED_LEN];
26911 let mut buf = if avail_len < Self::ENCODED_LEN {
26912 payload_buf[0..avail_len].copy_from_slice(__input);
26913 Bytes::new(&payload_buf)
26914 } else {
26915 Bytes::new(__input)
26916 };
26917 let mut __struct = Self::default();
26918 __struct.initial_timestamp = buf.get_u64_le();
26919 __struct.target_system = buf.get_u8();
26920 __struct.target_component = buf.get_u8();
26921 for v in &mut __struct.secret_key {
26922 let val = buf.get_u8();
26923 *v = val;
26924 }
26925 Ok(__struct)
26926 }
26927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26928 let mut __tmp = BytesMut::new(bytes);
26929 #[allow(clippy::absurd_extreme_comparisons)]
26930 #[allow(unused_comparisons)]
26931 if __tmp.remaining() < Self::ENCODED_LEN {
26932 panic!(
26933 "buffer is too small (need {} bytes, but got {})",
26934 Self::ENCODED_LEN,
26935 __tmp.remaining(),
26936 )
26937 }
26938 __tmp.put_u64_le(self.initial_timestamp);
26939 __tmp.put_u8(self.target_system);
26940 __tmp.put_u8(self.target_component);
26941 for val in &self.secret_key {
26942 __tmp.put_u8(*val);
26943 }
26944 if matches!(version, MavlinkVersion::V2) {
26945 let len = __tmp.len();
26946 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26947 } else {
26948 __tmp.len()
26949 }
26950 }
26951}
26952#[doc = "id: 139"]
26953#[doc = "Set the vehicle attitude and body angular rates."]
26954#[derive(Debug, Clone, PartialEq)]
26955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26957pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
26958 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26959 pub time_usec: u64,
26960 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
26961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26962 pub controls: [f32; 8],
26963 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
26964 pub group_mlx: u8,
26965 #[doc = "System ID"]
26966 pub target_system: u8,
26967 #[doc = "Component ID"]
26968 pub target_component: u8,
26969}
26970impl SET_ACTUATOR_CONTROL_TARGET_DATA {
26971 pub const ENCODED_LEN: usize = 43usize;
26972 pub const DEFAULT: Self = Self {
26973 time_usec: 0_u64,
26974 controls: [0.0_f32; 8usize],
26975 group_mlx: 0_u8,
26976 target_system: 0_u8,
26977 target_component: 0_u8,
26978 };
26979 #[cfg(feature = "arbitrary")]
26980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26981 use arbitrary::{Arbitrary, Unstructured};
26982 let mut buf = [0u8; 1024];
26983 rng.fill_bytes(&mut buf);
26984 let mut unstructured = Unstructured::new(&buf);
26985 Self::arbitrary(&mut unstructured).unwrap_or_default()
26986 }
26987}
26988impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
26989 fn default() -> Self {
26990 Self::DEFAULT.clone()
26991 }
26992}
26993impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
26994 type Message = MavMessage;
26995 const ID: u32 = 139u32;
26996 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
26997 const EXTRA_CRC: u8 = 168u8;
26998 const ENCODED_LEN: usize = 43usize;
26999 fn deser(
27000 _version: MavlinkVersion,
27001 __input: &[u8],
27002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27003 let avail_len = __input.len();
27004 let mut payload_buf = [0; Self::ENCODED_LEN];
27005 let mut buf = if avail_len < Self::ENCODED_LEN {
27006 payload_buf[0..avail_len].copy_from_slice(__input);
27007 Bytes::new(&payload_buf)
27008 } else {
27009 Bytes::new(__input)
27010 };
27011 let mut __struct = Self::default();
27012 __struct.time_usec = buf.get_u64_le();
27013 for v in &mut __struct.controls {
27014 let val = buf.get_f32_le();
27015 *v = val;
27016 }
27017 __struct.group_mlx = buf.get_u8();
27018 __struct.target_system = buf.get_u8();
27019 __struct.target_component = buf.get_u8();
27020 Ok(__struct)
27021 }
27022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27023 let mut __tmp = BytesMut::new(bytes);
27024 #[allow(clippy::absurd_extreme_comparisons)]
27025 #[allow(unused_comparisons)]
27026 if __tmp.remaining() < Self::ENCODED_LEN {
27027 panic!(
27028 "buffer is too small (need {} bytes, but got {})",
27029 Self::ENCODED_LEN,
27030 __tmp.remaining(),
27031 )
27032 }
27033 __tmp.put_u64_le(self.time_usec);
27034 for val in &self.controls {
27035 __tmp.put_f32_le(*val);
27036 }
27037 __tmp.put_u8(self.group_mlx);
27038 __tmp.put_u8(self.target_system);
27039 __tmp.put_u8(self.target_component);
27040 if matches!(version, MavlinkVersion::V2) {
27041 let len = __tmp.len();
27042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27043 } else {
27044 __tmp.len()
27045 }
27046 }
27047}
27048#[doc = "id: 82"]
27049#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27050#[derive(Debug, Clone, PartialEq)]
27051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27053pub struct SET_ATTITUDE_TARGET_DATA {
27054 #[doc = "Timestamp (time since system boot)."]
27055 pub time_boot_ms: u32,
27056 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27058 pub q: [f32; 4],
27059 #[doc = "Body roll rate"]
27060 pub body_roll_rate: f32,
27061 #[doc = "Body pitch rate"]
27062 pub body_pitch_rate: f32,
27063 #[doc = "Body yaw rate"]
27064 pub body_yaw_rate: f32,
27065 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27066 pub thrust: f32,
27067 #[doc = "System ID"]
27068 pub target_system: u8,
27069 #[doc = "Component ID"]
27070 pub target_component: u8,
27071 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27072 pub type_mask: AttitudeTargetTypemask,
27073 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27074 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27075 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27076 pub thrust_body: [f32; 3],
27077}
27078impl SET_ATTITUDE_TARGET_DATA {
27079 pub const ENCODED_LEN: usize = 51usize;
27080 pub const DEFAULT: Self = Self {
27081 time_boot_ms: 0_u32,
27082 q: [0.0_f32; 4usize],
27083 body_roll_rate: 0.0_f32,
27084 body_pitch_rate: 0.0_f32,
27085 body_yaw_rate: 0.0_f32,
27086 thrust: 0.0_f32,
27087 target_system: 0_u8,
27088 target_component: 0_u8,
27089 type_mask: AttitudeTargetTypemask::DEFAULT,
27090 thrust_body: [0.0_f32; 3usize],
27091 };
27092 #[cfg(feature = "arbitrary")]
27093 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27094 use arbitrary::{Arbitrary, Unstructured};
27095 let mut buf = [0u8; 1024];
27096 rng.fill_bytes(&mut buf);
27097 let mut unstructured = Unstructured::new(&buf);
27098 Self::arbitrary(&mut unstructured).unwrap_or_default()
27099 }
27100}
27101impl Default for SET_ATTITUDE_TARGET_DATA {
27102 fn default() -> Self {
27103 Self::DEFAULT.clone()
27104 }
27105}
27106impl MessageData for SET_ATTITUDE_TARGET_DATA {
27107 type Message = MavMessage;
27108 const ID: u32 = 82u32;
27109 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27110 const EXTRA_CRC: u8 = 49u8;
27111 const ENCODED_LEN: usize = 51usize;
27112 fn deser(
27113 _version: MavlinkVersion,
27114 __input: &[u8],
27115 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27116 let avail_len = __input.len();
27117 let mut payload_buf = [0; Self::ENCODED_LEN];
27118 let mut buf = if avail_len < Self::ENCODED_LEN {
27119 payload_buf[0..avail_len].copy_from_slice(__input);
27120 Bytes::new(&payload_buf)
27121 } else {
27122 Bytes::new(__input)
27123 };
27124 let mut __struct = Self::default();
27125 __struct.time_boot_ms = buf.get_u32_le();
27126 for v in &mut __struct.q {
27127 let val = buf.get_f32_le();
27128 *v = val;
27129 }
27130 __struct.body_roll_rate = buf.get_f32_le();
27131 __struct.body_pitch_rate = buf.get_f32_le();
27132 __struct.body_yaw_rate = buf.get_f32_le();
27133 __struct.thrust = buf.get_f32_le();
27134 __struct.target_system = buf.get_u8();
27135 __struct.target_component = buf.get_u8();
27136 let tmp = buf.get_u8();
27137 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27138 tmp & AttitudeTargetTypemask::all().bits(),
27139 )
27140 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27141 flag_type: "AttitudeTargetTypemask",
27142 value: tmp as u32,
27143 })?;
27144 for v in &mut __struct.thrust_body {
27145 let val = buf.get_f32_le();
27146 *v = val;
27147 }
27148 Ok(__struct)
27149 }
27150 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27151 let mut __tmp = BytesMut::new(bytes);
27152 #[allow(clippy::absurd_extreme_comparisons)]
27153 #[allow(unused_comparisons)]
27154 if __tmp.remaining() < Self::ENCODED_LEN {
27155 panic!(
27156 "buffer is too small (need {} bytes, but got {})",
27157 Self::ENCODED_LEN,
27158 __tmp.remaining(),
27159 )
27160 }
27161 __tmp.put_u32_le(self.time_boot_ms);
27162 for val in &self.q {
27163 __tmp.put_f32_le(*val);
27164 }
27165 __tmp.put_f32_le(self.body_roll_rate);
27166 __tmp.put_f32_le(self.body_pitch_rate);
27167 __tmp.put_f32_le(self.body_yaw_rate);
27168 __tmp.put_f32_le(self.thrust);
27169 __tmp.put_u8(self.target_system);
27170 __tmp.put_u8(self.target_component);
27171 __tmp.put_u8(self.type_mask.bits());
27172 for val in &self.thrust_body {
27173 __tmp.put_f32_le(*val);
27174 }
27175 if matches!(version, MavlinkVersion::V2) {
27176 let len = __tmp.len();
27177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27178 } else {
27179 __tmp.len()
27180 }
27181 }
27182}
27183#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27184#[doc = "id: 48"]
27185#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27186#[derive(Debug, Clone, PartialEq)]
27187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27189pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27190 #[doc = "Latitude (WGS84)"]
27191 pub latitude: i32,
27192 #[doc = "Longitude (WGS84)"]
27193 pub longitude: i32,
27194 #[doc = "Altitude (MSL). Positive for up."]
27195 pub altitude: i32,
27196 #[doc = "System ID"]
27197 pub target_system: u8,
27198 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27199 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27200 pub time_usec: u64,
27201}
27202impl SET_GPS_GLOBAL_ORIGIN_DATA {
27203 pub const ENCODED_LEN: usize = 21usize;
27204 pub const DEFAULT: Self = Self {
27205 latitude: 0_i32,
27206 longitude: 0_i32,
27207 altitude: 0_i32,
27208 target_system: 0_u8,
27209 time_usec: 0_u64,
27210 };
27211 #[cfg(feature = "arbitrary")]
27212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27213 use arbitrary::{Arbitrary, Unstructured};
27214 let mut buf = [0u8; 1024];
27215 rng.fill_bytes(&mut buf);
27216 let mut unstructured = Unstructured::new(&buf);
27217 Self::arbitrary(&mut unstructured).unwrap_or_default()
27218 }
27219}
27220impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27221 fn default() -> Self {
27222 Self::DEFAULT.clone()
27223 }
27224}
27225impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27226 type Message = MavMessage;
27227 const ID: u32 = 48u32;
27228 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27229 const EXTRA_CRC: u8 = 41u8;
27230 const ENCODED_LEN: usize = 21usize;
27231 fn deser(
27232 _version: MavlinkVersion,
27233 __input: &[u8],
27234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27235 let avail_len = __input.len();
27236 let mut payload_buf = [0; Self::ENCODED_LEN];
27237 let mut buf = if avail_len < Self::ENCODED_LEN {
27238 payload_buf[0..avail_len].copy_from_slice(__input);
27239 Bytes::new(&payload_buf)
27240 } else {
27241 Bytes::new(__input)
27242 };
27243 let mut __struct = Self::default();
27244 __struct.latitude = buf.get_i32_le();
27245 __struct.longitude = buf.get_i32_le();
27246 __struct.altitude = buf.get_i32_le();
27247 __struct.target_system = buf.get_u8();
27248 __struct.time_usec = buf.get_u64_le();
27249 Ok(__struct)
27250 }
27251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27252 let mut __tmp = BytesMut::new(bytes);
27253 #[allow(clippy::absurd_extreme_comparisons)]
27254 #[allow(unused_comparisons)]
27255 if __tmp.remaining() < Self::ENCODED_LEN {
27256 panic!(
27257 "buffer is too small (need {} bytes, but got {})",
27258 Self::ENCODED_LEN,
27259 __tmp.remaining(),
27260 )
27261 }
27262 __tmp.put_i32_le(self.latitude);
27263 __tmp.put_i32_le(self.longitude);
27264 __tmp.put_i32_le(self.altitude);
27265 __tmp.put_u8(self.target_system);
27266 __tmp.put_u64_le(self.time_usec);
27267 if matches!(version, MavlinkVersion::V2) {
27268 let len = __tmp.len();
27269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27270 } else {
27271 __tmp.len()
27272 }
27273 }
27274}
27275#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27276#[doc = "id: 243"]
27277#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27278#[derive(Debug, Clone, PartialEq)]
27279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27281pub struct SET_HOME_POSITION_DATA {
27282 #[doc = "Latitude (WGS84)"]
27283 pub latitude: i32,
27284 #[doc = "Longitude (WGS84)"]
27285 pub longitude: i32,
27286 #[doc = "Altitude (MSL). Positive for up."]
27287 pub altitude: i32,
27288 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27289 pub x: f32,
27290 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27291 pub y: f32,
27292 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27293 pub z: f32,
27294 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27295 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27296 pub q: [f32; 4],
27297 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27298 pub approach_x: f32,
27299 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27300 pub approach_y: f32,
27301 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27302 pub approach_z: f32,
27303 #[doc = "System ID."]
27304 pub target_system: u8,
27305 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27306 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27307 pub time_usec: u64,
27308}
27309impl SET_HOME_POSITION_DATA {
27310 pub const ENCODED_LEN: usize = 61usize;
27311 pub const DEFAULT: Self = Self {
27312 latitude: 0_i32,
27313 longitude: 0_i32,
27314 altitude: 0_i32,
27315 x: 0.0_f32,
27316 y: 0.0_f32,
27317 z: 0.0_f32,
27318 q: [0.0_f32; 4usize],
27319 approach_x: 0.0_f32,
27320 approach_y: 0.0_f32,
27321 approach_z: 0.0_f32,
27322 target_system: 0_u8,
27323 time_usec: 0_u64,
27324 };
27325 #[cfg(feature = "arbitrary")]
27326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27327 use arbitrary::{Arbitrary, Unstructured};
27328 let mut buf = [0u8; 1024];
27329 rng.fill_bytes(&mut buf);
27330 let mut unstructured = Unstructured::new(&buf);
27331 Self::arbitrary(&mut unstructured).unwrap_or_default()
27332 }
27333}
27334impl Default for SET_HOME_POSITION_DATA {
27335 fn default() -> Self {
27336 Self::DEFAULT.clone()
27337 }
27338}
27339impl MessageData for SET_HOME_POSITION_DATA {
27340 type Message = MavMessage;
27341 const ID: u32 = 243u32;
27342 const NAME: &'static str = "SET_HOME_POSITION";
27343 const EXTRA_CRC: u8 = 85u8;
27344 const ENCODED_LEN: usize = 61usize;
27345 fn deser(
27346 _version: MavlinkVersion,
27347 __input: &[u8],
27348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27349 let avail_len = __input.len();
27350 let mut payload_buf = [0; Self::ENCODED_LEN];
27351 let mut buf = if avail_len < Self::ENCODED_LEN {
27352 payload_buf[0..avail_len].copy_from_slice(__input);
27353 Bytes::new(&payload_buf)
27354 } else {
27355 Bytes::new(__input)
27356 };
27357 let mut __struct = Self::default();
27358 __struct.latitude = buf.get_i32_le();
27359 __struct.longitude = buf.get_i32_le();
27360 __struct.altitude = buf.get_i32_le();
27361 __struct.x = buf.get_f32_le();
27362 __struct.y = buf.get_f32_le();
27363 __struct.z = buf.get_f32_le();
27364 for v in &mut __struct.q {
27365 let val = buf.get_f32_le();
27366 *v = val;
27367 }
27368 __struct.approach_x = buf.get_f32_le();
27369 __struct.approach_y = buf.get_f32_le();
27370 __struct.approach_z = buf.get_f32_le();
27371 __struct.target_system = buf.get_u8();
27372 __struct.time_usec = buf.get_u64_le();
27373 Ok(__struct)
27374 }
27375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27376 let mut __tmp = BytesMut::new(bytes);
27377 #[allow(clippy::absurd_extreme_comparisons)]
27378 #[allow(unused_comparisons)]
27379 if __tmp.remaining() < Self::ENCODED_LEN {
27380 panic!(
27381 "buffer is too small (need {} bytes, but got {})",
27382 Self::ENCODED_LEN,
27383 __tmp.remaining(),
27384 )
27385 }
27386 __tmp.put_i32_le(self.latitude);
27387 __tmp.put_i32_le(self.longitude);
27388 __tmp.put_i32_le(self.altitude);
27389 __tmp.put_f32_le(self.x);
27390 __tmp.put_f32_le(self.y);
27391 __tmp.put_f32_le(self.z);
27392 for val in &self.q {
27393 __tmp.put_f32_le(*val);
27394 }
27395 __tmp.put_f32_le(self.approach_x);
27396 __tmp.put_f32_le(self.approach_y);
27397 __tmp.put_f32_le(self.approach_z);
27398 __tmp.put_u8(self.target_system);
27399 __tmp.put_u64_le(self.time_usec);
27400 if matches!(version, MavlinkVersion::V2) {
27401 let len = __tmp.len();
27402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27403 } else {
27404 __tmp.len()
27405 }
27406 }
27407}
27408#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27409#[doc = "id: 11"]
27410#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27411#[derive(Debug, Clone, PartialEq)]
27412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27414pub struct SET_MODE_DATA {
27415 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27416 pub custom_mode: u32,
27417 #[doc = "The system setting the mode"]
27418 pub target_system: u8,
27419 #[doc = "The new base mode."]
27420 pub base_mode: MavMode,
27421}
27422impl SET_MODE_DATA {
27423 pub const ENCODED_LEN: usize = 6usize;
27424 pub const DEFAULT: Self = Self {
27425 custom_mode: 0_u32,
27426 target_system: 0_u8,
27427 base_mode: MavMode::DEFAULT,
27428 };
27429 #[cfg(feature = "arbitrary")]
27430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27431 use arbitrary::{Arbitrary, Unstructured};
27432 let mut buf = [0u8; 1024];
27433 rng.fill_bytes(&mut buf);
27434 let mut unstructured = Unstructured::new(&buf);
27435 Self::arbitrary(&mut unstructured).unwrap_or_default()
27436 }
27437}
27438impl Default for SET_MODE_DATA {
27439 fn default() -> Self {
27440 Self::DEFAULT.clone()
27441 }
27442}
27443impl MessageData for SET_MODE_DATA {
27444 type Message = MavMessage;
27445 const ID: u32 = 11u32;
27446 const NAME: &'static str = "SET_MODE";
27447 const EXTRA_CRC: u8 = 89u8;
27448 const ENCODED_LEN: usize = 6usize;
27449 fn deser(
27450 _version: MavlinkVersion,
27451 __input: &[u8],
27452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27453 let avail_len = __input.len();
27454 let mut payload_buf = [0; Self::ENCODED_LEN];
27455 let mut buf = if avail_len < Self::ENCODED_LEN {
27456 payload_buf[0..avail_len].copy_from_slice(__input);
27457 Bytes::new(&payload_buf)
27458 } else {
27459 Bytes::new(__input)
27460 };
27461 let mut __struct = Self::default();
27462 __struct.custom_mode = buf.get_u32_le();
27463 __struct.target_system = buf.get_u8();
27464 let tmp = buf.get_u8();
27465 __struct.base_mode =
27466 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27467 enum_type: "MavMode",
27468 value: tmp as u32,
27469 })?;
27470 Ok(__struct)
27471 }
27472 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27473 let mut __tmp = BytesMut::new(bytes);
27474 #[allow(clippy::absurd_extreme_comparisons)]
27475 #[allow(unused_comparisons)]
27476 if __tmp.remaining() < Self::ENCODED_LEN {
27477 panic!(
27478 "buffer is too small (need {} bytes, but got {})",
27479 Self::ENCODED_LEN,
27480 __tmp.remaining(),
27481 )
27482 }
27483 __tmp.put_u32_le(self.custom_mode);
27484 __tmp.put_u8(self.target_system);
27485 __tmp.put_u8(self.base_mode as u8);
27486 if matches!(version, MavlinkVersion::V2) {
27487 let len = __tmp.len();
27488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27489 } else {
27490 __tmp.len()
27491 }
27492 }
27493}
27494#[doc = "id: 86"]
27495#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27496#[derive(Debug, Clone, PartialEq)]
27497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27499pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27500 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27501 pub time_boot_ms: u32,
27502 #[doc = "Latitude in WGS84 frame"]
27503 pub lat_int: i32,
27504 #[doc = "Longitude in WGS84 frame"]
27505 pub lon_int: i32,
27506 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27507 pub alt: f32,
27508 #[doc = "X velocity in NED frame"]
27509 pub vx: f32,
27510 #[doc = "Y velocity in NED frame"]
27511 pub vy: f32,
27512 #[doc = "Z velocity in NED frame"]
27513 pub vz: f32,
27514 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27515 pub afx: f32,
27516 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27517 pub afy: f32,
27518 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27519 pub afz: f32,
27520 #[doc = "yaw setpoint"]
27521 pub yaw: f32,
27522 #[doc = "yaw rate setpoint"]
27523 pub yaw_rate: f32,
27524 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27525 pub type_mask: PositionTargetTypemask,
27526 #[doc = "System ID"]
27527 pub target_system: u8,
27528 #[doc = "Component ID"]
27529 pub target_component: u8,
27530 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27531 pub coordinate_frame: MavFrame,
27532}
27533impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27534 pub const ENCODED_LEN: usize = 53usize;
27535 pub const DEFAULT: Self = Self {
27536 time_boot_ms: 0_u32,
27537 lat_int: 0_i32,
27538 lon_int: 0_i32,
27539 alt: 0.0_f32,
27540 vx: 0.0_f32,
27541 vy: 0.0_f32,
27542 vz: 0.0_f32,
27543 afx: 0.0_f32,
27544 afy: 0.0_f32,
27545 afz: 0.0_f32,
27546 yaw: 0.0_f32,
27547 yaw_rate: 0.0_f32,
27548 type_mask: PositionTargetTypemask::DEFAULT,
27549 target_system: 0_u8,
27550 target_component: 0_u8,
27551 coordinate_frame: MavFrame::DEFAULT,
27552 };
27553 #[cfg(feature = "arbitrary")]
27554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27555 use arbitrary::{Arbitrary, Unstructured};
27556 let mut buf = [0u8; 1024];
27557 rng.fill_bytes(&mut buf);
27558 let mut unstructured = Unstructured::new(&buf);
27559 Self::arbitrary(&mut unstructured).unwrap_or_default()
27560 }
27561}
27562impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27563 fn default() -> Self {
27564 Self::DEFAULT.clone()
27565 }
27566}
27567impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27568 type Message = MavMessage;
27569 const ID: u32 = 86u32;
27570 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27571 const EXTRA_CRC: u8 = 5u8;
27572 const ENCODED_LEN: usize = 53usize;
27573 fn deser(
27574 _version: MavlinkVersion,
27575 __input: &[u8],
27576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27577 let avail_len = __input.len();
27578 let mut payload_buf = [0; Self::ENCODED_LEN];
27579 let mut buf = if avail_len < Self::ENCODED_LEN {
27580 payload_buf[0..avail_len].copy_from_slice(__input);
27581 Bytes::new(&payload_buf)
27582 } else {
27583 Bytes::new(__input)
27584 };
27585 let mut __struct = Self::default();
27586 __struct.time_boot_ms = buf.get_u32_le();
27587 __struct.lat_int = buf.get_i32_le();
27588 __struct.lon_int = buf.get_i32_le();
27589 __struct.alt = buf.get_f32_le();
27590 __struct.vx = buf.get_f32_le();
27591 __struct.vy = buf.get_f32_le();
27592 __struct.vz = buf.get_f32_le();
27593 __struct.afx = buf.get_f32_le();
27594 __struct.afy = buf.get_f32_le();
27595 __struct.afz = buf.get_f32_le();
27596 __struct.yaw = buf.get_f32_le();
27597 __struct.yaw_rate = buf.get_f32_le();
27598 let tmp = buf.get_u16_le();
27599 __struct.type_mask = PositionTargetTypemask::from_bits(
27600 tmp & PositionTargetTypemask::all().bits(),
27601 )
27602 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27603 flag_type: "PositionTargetTypemask",
27604 value: tmp as u32,
27605 })?;
27606 __struct.target_system = buf.get_u8();
27607 __struct.target_component = buf.get_u8();
27608 let tmp = buf.get_u8();
27609 __struct.coordinate_frame =
27610 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27611 enum_type: "MavFrame",
27612 value: tmp as u32,
27613 })?;
27614 Ok(__struct)
27615 }
27616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27617 let mut __tmp = BytesMut::new(bytes);
27618 #[allow(clippy::absurd_extreme_comparisons)]
27619 #[allow(unused_comparisons)]
27620 if __tmp.remaining() < Self::ENCODED_LEN {
27621 panic!(
27622 "buffer is too small (need {} bytes, but got {})",
27623 Self::ENCODED_LEN,
27624 __tmp.remaining(),
27625 )
27626 }
27627 __tmp.put_u32_le(self.time_boot_ms);
27628 __tmp.put_i32_le(self.lat_int);
27629 __tmp.put_i32_le(self.lon_int);
27630 __tmp.put_f32_le(self.alt);
27631 __tmp.put_f32_le(self.vx);
27632 __tmp.put_f32_le(self.vy);
27633 __tmp.put_f32_le(self.vz);
27634 __tmp.put_f32_le(self.afx);
27635 __tmp.put_f32_le(self.afy);
27636 __tmp.put_f32_le(self.afz);
27637 __tmp.put_f32_le(self.yaw);
27638 __tmp.put_f32_le(self.yaw_rate);
27639 __tmp.put_u16_le(self.type_mask.bits());
27640 __tmp.put_u8(self.target_system);
27641 __tmp.put_u8(self.target_component);
27642 __tmp.put_u8(self.coordinate_frame as u8);
27643 if matches!(version, MavlinkVersion::V2) {
27644 let len = __tmp.len();
27645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27646 } else {
27647 __tmp.len()
27648 }
27649 }
27650}
27651#[doc = "id: 84"]
27652#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27653#[derive(Debug, Clone, PartialEq)]
27654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27656pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27657 #[doc = "Timestamp (time since system boot)."]
27658 pub time_boot_ms: u32,
27659 #[doc = "X Position in NED frame"]
27660 pub x: f32,
27661 #[doc = "Y Position in NED frame"]
27662 pub y: f32,
27663 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27664 pub z: f32,
27665 #[doc = "X velocity in NED frame"]
27666 pub vx: f32,
27667 #[doc = "Y velocity in NED frame"]
27668 pub vy: f32,
27669 #[doc = "Z velocity in NED frame"]
27670 pub vz: f32,
27671 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27672 pub afx: f32,
27673 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27674 pub afy: f32,
27675 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27676 pub afz: f32,
27677 #[doc = "yaw setpoint"]
27678 pub yaw: f32,
27679 #[doc = "yaw rate setpoint"]
27680 pub yaw_rate: f32,
27681 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27682 pub type_mask: PositionTargetTypemask,
27683 #[doc = "System ID"]
27684 pub target_system: u8,
27685 #[doc = "Component ID"]
27686 pub target_component: u8,
27687 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27688 pub coordinate_frame: MavFrame,
27689}
27690impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27691 pub const ENCODED_LEN: usize = 53usize;
27692 pub const DEFAULT: Self = Self {
27693 time_boot_ms: 0_u32,
27694 x: 0.0_f32,
27695 y: 0.0_f32,
27696 z: 0.0_f32,
27697 vx: 0.0_f32,
27698 vy: 0.0_f32,
27699 vz: 0.0_f32,
27700 afx: 0.0_f32,
27701 afy: 0.0_f32,
27702 afz: 0.0_f32,
27703 yaw: 0.0_f32,
27704 yaw_rate: 0.0_f32,
27705 type_mask: PositionTargetTypemask::DEFAULT,
27706 target_system: 0_u8,
27707 target_component: 0_u8,
27708 coordinate_frame: MavFrame::DEFAULT,
27709 };
27710 #[cfg(feature = "arbitrary")]
27711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27712 use arbitrary::{Arbitrary, Unstructured};
27713 let mut buf = [0u8; 1024];
27714 rng.fill_bytes(&mut buf);
27715 let mut unstructured = Unstructured::new(&buf);
27716 Self::arbitrary(&mut unstructured).unwrap_or_default()
27717 }
27718}
27719impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27720 fn default() -> Self {
27721 Self::DEFAULT.clone()
27722 }
27723}
27724impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27725 type Message = MavMessage;
27726 const ID: u32 = 84u32;
27727 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27728 const EXTRA_CRC: u8 = 143u8;
27729 const ENCODED_LEN: usize = 53usize;
27730 fn deser(
27731 _version: MavlinkVersion,
27732 __input: &[u8],
27733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27734 let avail_len = __input.len();
27735 let mut payload_buf = [0; Self::ENCODED_LEN];
27736 let mut buf = if avail_len < Self::ENCODED_LEN {
27737 payload_buf[0..avail_len].copy_from_slice(__input);
27738 Bytes::new(&payload_buf)
27739 } else {
27740 Bytes::new(__input)
27741 };
27742 let mut __struct = Self::default();
27743 __struct.time_boot_ms = buf.get_u32_le();
27744 __struct.x = buf.get_f32_le();
27745 __struct.y = buf.get_f32_le();
27746 __struct.z = buf.get_f32_le();
27747 __struct.vx = buf.get_f32_le();
27748 __struct.vy = buf.get_f32_le();
27749 __struct.vz = buf.get_f32_le();
27750 __struct.afx = buf.get_f32_le();
27751 __struct.afy = buf.get_f32_le();
27752 __struct.afz = buf.get_f32_le();
27753 __struct.yaw = buf.get_f32_le();
27754 __struct.yaw_rate = buf.get_f32_le();
27755 let tmp = buf.get_u16_le();
27756 __struct.type_mask = PositionTargetTypemask::from_bits(
27757 tmp & PositionTargetTypemask::all().bits(),
27758 )
27759 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27760 flag_type: "PositionTargetTypemask",
27761 value: tmp as u32,
27762 })?;
27763 __struct.target_system = buf.get_u8();
27764 __struct.target_component = buf.get_u8();
27765 let tmp = buf.get_u8();
27766 __struct.coordinate_frame =
27767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27768 enum_type: "MavFrame",
27769 value: tmp as u32,
27770 })?;
27771 Ok(__struct)
27772 }
27773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27774 let mut __tmp = BytesMut::new(bytes);
27775 #[allow(clippy::absurd_extreme_comparisons)]
27776 #[allow(unused_comparisons)]
27777 if __tmp.remaining() < Self::ENCODED_LEN {
27778 panic!(
27779 "buffer is too small (need {} bytes, but got {})",
27780 Self::ENCODED_LEN,
27781 __tmp.remaining(),
27782 )
27783 }
27784 __tmp.put_u32_le(self.time_boot_ms);
27785 __tmp.put_f32_le(self.x);
27786 __tmp.put_f32_le(self.y);
27787 __tmp.put_f32_le(self.z);
27788 __tmp.put_f32_le(self.vx);
27789 __tmp.put_f32_le(self.vy);
27790 __tmp.put_f32_le(self.vz);
27791 __tmp.put_f32_le(self.afx);
27792 __tmp.put_f32_le(self.afy);
27793 __tmp.put_f32_le(self.afz);
27794 __tmp.put_f32_le(self.yaw);
27795 __tmp.put_f32_le(self.yaw_rate);
27796 __tmp.put_u16_le(self.type_mask.bits());
27797 __tmp.put_u8(self.target_system);
27798 __tmp.put_u8(self.target_component);
27799 __tmp.put_u8(self.coordinate_frame as u8);
27800 if matches!(version, MavlinkVersion::V2) {
27801 let len = __tmp.len();
27802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27803 } else {
27804 __tmp.len()
27805 }
27806 }
27807}
27808#[doc = "id: 108"]
27809#[doc = "Status of simulation environment, if used."]
27810#[derive(Debug, Clone, PartialEq)]
27811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27813pub struct SIM_STATE_DATA {
27814 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27815 pub q1: f32,
27816 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27817 pub q2: f32,
27818 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27819 pub q3: f32,
27820 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27821 pub q4: f32,
27822 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27823 pub roll: f32,
27824 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27825 pub pitch: f32,
27826 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27827 pub yaw: f32,
27828 #[doc = "X acceleration"]
27829 pub xacc: f32,
27830 #[doc = "Y acceleration"]
27831 pub yacc: f32,
27832 #[doc = "Z acceleration"]
27833 pub zacc: f32,
27834 #[doc = "Angular speed around X axis"]
27835 pub xgyro: f32,
27836 #[doc = "Angular speed around Y axis"]
27837 pub ygyro: f32,
27838 #[doc = "Angular speed around Z axis"]
27839 pub zgyro: f32,
27840 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27841 pub lat: f32,
27842 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27843 pub lon: f32,
27844 #[doc = "Altitude"]
27845 pub alt: f32,
27846 #[doc = "Horizontal position standard deviation"]
27847 pub std_dev_horz: f32,
27848 #[doc = "Vertical position standard deviation"]
27849 pub std_dev_vert: f32,
27850 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27851 pub vn: f32,
27852 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27853 pub ve: f32,
27854 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27855 pub vd: f32,
27856 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27858 pub lat_int: i32,
27859 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27860 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27861 pub lon_int: i32,
27862}
27863impl SIM_STATE_DATA {
27864 pub const ENCODED_LEN: usize = 92usize;
27865 pub const DEFAULT: Self = Self {
27866 q1: 0.0_f32,
27867 q2: 0.0_f32,
27868 q3: 0.0_f32,
27869 q4: 0.0_f32,
27870 roll: 0.0_f32,
27871 pitch: 0.0_f32,
27872 yaw: 0.0_f32,
27873 xacc: 0.0_f32,
27874 yacc: 0.0_f32,
27875 zacc: 0.0_f32,
27876 xgyro: 0.0_f32,
27877 ygyro: 0.0_f32,
27878 zgyro: 0.0_f32,
27879 lat: 0.0_f32,
27880 lon: 0.0_f32,
27881 alt: 0.0_f32,
27882 std_dev_horz: 0.0_f32,
27883 std_dev_vert: 0.0_f32,
27884 vn: 0.0_f32,
27885 ve: 0.0_f32,
27886 vd: 0.0_f32,
27887 lat_int: 0_i32,
27888 lon_int: 0_i32,
27889 };
27890 #[cfg(feature = "arbitrary")]
27891 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27892 use arbitrary::{Arbitrary, Unstructured};
27893 let mut buf = [0u8; 1024];
27894 rng.fill_bytes(&mut buf);
27895 let mut unstructured = Unstructured::new(&buf);
27896 Self::arbitrary(&mut unstructured).unwrap_or_default()
27897 }
27898}
27899impl Default for SIM_STATE_DATA {
27900 fn default() -> Self {
27901 Self::DEFAULT.clone()
27902 }
27903}
27904impl MessageData for SIM_STATE_DATA {
27905 type Message = MavMessage;
27906 const ID: u32 = 108u32;
27907 const NAME: &'static str = "SIM_STATE";
27908 const EXTRA_CRC: u8 = 32u8;
27909 const ENCODED_LEN: usize = 92usize;
27910 fn deser(
27911 _version: MavlinkVersion,
27912 __input: &[u8],
27913 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27914 let avail_len = __input.len();
27915 let mut payload_buf = [0; Self::ENCODED_LEN];
27916 let mut buf = if avail_len < Self::ENCODED_LEN {
27917 payload_buf[0..avail_len].copy_from_slice(__input);
27918 Bytes::new(&payload_buf)
27919 } else {
27920 Bytes::new(__input)
27921 };
27922 let mut __struct = Self::default();
27923 __struct.q1 = buf.get_f32_le();
27924 __struct.q2 = buf.get_f32_le();
27925 __struct.q3 = buf.get_f32_le();
27926 __struct.q4 = buf.get_f32_le();
27927 __struct.roll = buf.get_f32_le();
27928 __struct.pitch = buf.get_f32_le();
27929 __struct.yaw = buf.get_f32_le();
27930 __struct.xacc = buf.get_f32_le();
27931 __struct.yacc = buf.get_f32_le();
27932 __struct.zacc = buf.get_f32_le();
27933 __struct.xgyro = buf.get_f32_le();
27934 __struct.ygyro = buf.get_f32_le();
27935 __struct.zgyro = buf.get_f32_le();
27936 __struct.lat = buf.get_f32_le();
27937 __struct.lon = buf.get_f32_le();
27938 __struct.alt = buf.get_f32_le();
27939 __struct.std_dev_horz = buf.get_f32_le();
27940 __struct.std_dev_vert = buf.get_f32_le();
27941 __struct.vn = buf.get_f32_le();
27942 __struct.ve = buf.get_f32_le();
27943 __struct.vd = buf.get_f32_le();
27944 __struct.lat_int = buf.get_i32_le();
27945 __struct.lon_int = buf.get_i32_le();
27946 Ok(__struct)
27947 }
27948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27949 let mut __tmp = BytesMut::new(bytes);
27950 #[allow(clippy::absurd_extreme_comparisons)]
27951 #[allow(unused_comparisons)]
27952 if __tmp.remaining() < Self::ENCODED_LEN {
27953 panic!(
27954 "buffer is too small (need {} bytes, but got {})",
27955 Self::ENCODED_LEN,
27956 __tmp.remaining(),
27957 )
27958 }
27959 __tmp.put_f32_le(self.q1);
27960 __tmp.put_f32_le(self.q2);
27961 __tmp.put_f32_le(self.q3);
27962 __tmp.put_f32_le(self.q4);
27963 __tmp.put_f32_le(self.roll);
27964 __tmp.put_f32_le(self.pitch);
27965 __tmp.put_f32_le(self.yaw);
27966 __tmp.put_f32_le(self.xacc);
27967 __tmp.put_f32_le(self.yacc);
27968 __tmp.put_f32_le(self.zacc);
27969 __tmp.put_f32_le(self.xgyro);
27970 __tmp.put_f32_le(self.ygyro);
27971 __tmp.put_f32_le(self.zgyro);
27972 __tmp.put_f32_le(self.lat);
27973 __tmp.put_f32_le(self.lon);
27974 __tmp.put_f32_le(self.alt);
27975 __tmp.put_f32_le(self.std_dev_horz);
27976 __tmp.put_f32_le(self.std_dev_vert);
27977 __tmp.put_f32_le(self.vn);
27978 __tmp.put_f32_le(self.ve);
27979 __tmp.put_f32_le(self.vd);
27980 __tmp.put_i32_le(self.lat_int);
27981 __tmp.put_i32_le(self.lon_int);
27982 if matches!(version, MavlinkVersion::V2) {
27983 let len = __tmp.len();
27984 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27985 } else {
27986 __tmp.len()
27987 }
27988 }
27989}
27990#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
27991#[doc = "id: 370"]
27992#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27993#[derive(Debug, Clone, PartialEq)]
27994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27996pub struct SMART_BATTERY_INFO_DATA {
27997 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27998 pub capacity_full_specification: i32,
27999 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28000 pub capacity_full: i32,
28001 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28002 pub cycle_count: u16,
28003 #[doc = "Battery weight. 0: field not provided."]
28004 pub weight: u16,
28005 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28006 pub discharge_minimum_voltage: u16,
28007 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28008 pub charging_minimum_voltage: u16,
28009 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28010 pub resting_minimum_voltage: u16,
28011 #[doc = "Battery ID"]
28012 pub id: u8,
28013 #[doc = "Function of the battery"]
28014 pub battery_function: MavBatteryFunction,
28015 #[doc = "Type (chemistry) of the battery"]
28016 pub mavtype: MavBatteryType,
28017 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28019 pub serial_number: [u8; 16],
28020 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28021 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28022 pub device_name: [u8; 50],
28023 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28025 pub charging_maximum_voltage: u16,
28026 #[doc = "Number of battery cells in series. 0: field not provided."]
28027 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28028 pub cells_in_series: u8,
28029 #[doc = "Maximum pack discharge current. 0: field not provided."]
28030 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28031 pub discharge_maximum_current: u32,
28032 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28034 pub discharge_maximum_burst_current: u32,
28035 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28036 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28038 pub manufacture_date: [u8; 11],
28039}
28040impl SMART_BATTERY_INFO_DATA {
28041 pub const ENCODED_LEN: usize = 109usize;
28042 pub const DEFAULT: Self = Self {
28043 capacity_full_specification: 0_i32,
28044 capacity_full: 0_i32,
28045 cycle_count: 0_u16,
28046 weight: 0_u16,
28047 discharge_minimum_voltage: 0_u16,
28048 charging_minimum_voltage: 0_u16,
28049 resting_minimum_voltage: 0_u16,
28050 id: 0_u8,
28051 battery_function: MavBatteryFunction::DEFAULT,
28052 mavtype: MavBatteryType::DEFAULT,
28053 serial_number: [0_u8; 16usize],
28054 device_name: [0_u8; 50usize],
28055 charging_maximum_voltage: 0_u16,
28056 cells_in_series: 0_u8,
28057 discharge_maximum_current: 0_u32,
28058 discharge_maximum_burst_current: 0_u32,
28059 manufacture_date: [0_u8; 11usize],
28060 };
28061 #[cfg(feature = "arbitrary")]
28062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28063 use arbitrary::{Arbitrary, Unstructured};
28064 let mut buf = [0u8; 1024];
28065 rng.fill_bytes(&mut buf);
28066 let mut unstructured = Unstructured::new(&buf);
28067 Self::arbitrary(&mut unstructured).unwrap_or_default()
28068 }
28069}
28070impl Default for SMART_BATTERY_INFO_DATA {
28071 fn default() -> Self {
28072 Self::DEFAULT.clone()
28073 }
28074}
28075impl MessageData for SMART_BATTERY_INFO_DATA {
28076 type Message = MavMessage;
28077 const ID: u32 = 370u32;
28078 const NAME: &'static str = "SMART_BATTERY_INFO";
28079 const EXTRA_CRC: u8 = 75u8;
28080 const ENCODED_LEN: usize = 109usize;
28081 fn deser(
28082 _version: MavlinkVersion,
28083 __input: &[u8],
28084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28085 let avail_len = __input.len();
28086 let mut payload_buf = [0; Self::ENCODED_LEN];
28087 let mut buf = if avail_len < Self::ENCODED_LEN {
28088 payload_buf[0..avail_len].copy_from_slice(__input);
28089 Bytes::new(&payload_buf)
28090 } else {
28091 Bytes::new(__input)
28092 };
28093 let mut __struct = Self::default();
28094 __struct.capacity_full_specification = buf.get_i32_le();
28095 __struct.capacity_full = buf.get_i32_le();
28096 __struct.cycle_count = buf.get_u16_le();
28097 __struct.weight = buf.get_u16_le();
28098 __struct.discharge_minimum_voltage = buf.get_u16_le();
28099 __struct.charging_minimum_voltage = buf.get_u16_le();
28100 __struct.resting_minimum_voltage = buf.get_u16_le();
28101 __struct.id = buf.get_u8();
28102 let tmp = buf.get_u8();
28103 __struct.battery_function =
28104 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28105 enum_type: "MavBatteryFunction",
28106 value: tmp as u32,
28107 })?;
28108 let tmp = buf.get_u8();
28109 __struct.mavtype =
28110 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28111 enum_type: "MavBatteryType",
28112 value: tmp as u32,
28113 })?;
28114 for v in &mut __struct.serial_number {
28115 let val = buf.get_u8();
28116 *v = val;
28117 }
28118 for v in &mut __struct.device_name {
28119 let val = buf.get_u8();
28120 *v = val;
28121 }
28122 __struct.charging_maximum_voltage = buf.get_u16_le();
28123 __struct.cells_in_series = buf.get_u8();
28124 __struct.discharge_maximum_current = buf.get_u32_le();
28125 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28126 for v in &mut __struct.manufacture_date {
28127 let val = buf.get_u8();
28128 *v = val;
28129 }
28130 Ok(__struct)
28131 }
28132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28133 let mut __tmp = BytesMut::new(bytes);
28134 #[allow(clippy::absurd_extreme_comparisons)]
28135 #[allow(unused_comparisons)]
28136 if __tmp.remaining() < Self::ENCODED_LEN {
28137 panic!(
28138 "buffer is too small (need {} bytes, but got {})",
28139 Self::ENCODED_LEN,
28140 __tmp.remaining(),
28141 )
28142 }
28143 __tmp.put_i32_le(self.capacity_full_specification);
28144 __tmp.put_i32_le(self.capacity_full);
28145 __tmp.put_u16_le(self.cycle_count);
28146 __tmp.put_u16_le(self.weight);
28147 __tmp.put_u16_le(self.discharge_minimum_voltage);
28148 __tmp.put_u16_le(self.charging_minimum_voltage);
28149 __tmp.put_u16_le(self.resting_minimum_voltage);
28150 __tmp.put_u8(self.id);
28151 __tmp.put_u8(self.battery_function as u8);
28152 __tmp.put_u8(self.mavtype as u8);
28153 for val in &self.serial_number {
28154 __tmp.put_u8(*val);
28155 }
28156 for val in &self.device_name {
28157 __tmp.put_u8(*val);
28158 }
28159 __tmp.put_u16_le(self.charging_maximum_voltage);
28160 __tmp.put_u8(self.cells_in_series);
28161 __tmp.put_u32_le(self.discharge_maximum_current);
28162 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28163 for val in &self.manufacture_date {
28164 __tmp.put_u8(*val);
28165 }
28166 if matches!(version, MavlinkVersion::V2) {
28167 let len = __tmp.len();
28168 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28169 } else {
28170 __tmp.len()
28171 }
28172 }
28173}
28174#[doc = "id: 253"]
28175#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28176#[derive(Debug, Clone, PartialEq)]
28177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28179pub struct STATUSTEXT_DATA {
28180 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28181 pub severity: MavSeverity,
28182 #[doc = "Status text message, without null termination character"]
28183 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28184 pub text: [u8; 50],
28185 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28186 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28187 pub id: u16,
28188 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28189 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28190 pub chunk_seq: u8,
28191}
28192impl STATUSTEXT_DATA {
28193 pub const ENCODED_LEN: usize = 54usize;
28194 pub const DEFAULT: Self = Self {
28195 severity: MavSeverity::DEFAULT,
28196 text: [0_u8; 50usize],
28197 id: 0_u16,
28198 chunk_seq: 0_u8,
28199 };
28200 #[cfg(feature = "arbitrary")]
28201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28202 use arbitrary::{Arbitrary, Unstructured};
28203 let mut buf = [0u8; 1024];
28204 rng.fill_bytes(&mut buf);
28205 let mut unstructured = Unstructured::new(&buf);
28206 Self::arbitrary(&mut unstructured).unwrap_or_default()
28207 }
28208}
28209impl Default for STATUSTEXT_DATA {
28210 fn default() -> Self {
28211 Self::DEFAULT.clone()
28212 }
28213}
28214impl MessageData for STATUSTEXT_DATA {
28215 type Message = MavMessage;
28216 const ID: u32 = 253u32;
28217 const NAME: &'static str = "STATUSTEXT";
28218 const EXTRA_CRC: u8 = 83u8;
28219 const ENCODED_LEN: usize = 54usize;
28220 fn deser(
28221 _version: MavlinkVersion,
28222 __input: &[u8],
28223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28224 let avail_len = __input.len();
28225 let mut payload_buf = [0; Self::ENCODED_LEN];
28226 let mut buf = if avail_len < Self::ENCODED_LEN {
28227 payload_buf[0..avail_len].copy_from_slice(__input);
28228 Bytes::new(&payload_buf)
28229 } else {
28230 Bytes::new(__input)
28231 };
28232 let mut __struct = Self::default();
28233 let tmp = buf.get_u8();
28234 __struct.severity =
28235 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28236 enum_type: "MavSeverity",
28237 value: tmp as u32,
28238 })?;
28239 for v in &mut __struct.text {
28240 let val = buf.get_u8();
28241 *v = val;
28242 }
28243 __struct.id = buf.get_u16_le();
28244 __struct.chunk_seq = buf.get_u8();
28245 Ok(__struct)
28246 }
28247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28248 let mut __tmp = BytesMut::new(bytes);
28249 #[allow(clippy::absurd_extreme_comparisons)]
28250 #[allow(unused_comparisons)]
28251 if __tmp.remaining() < Self::ENCODED_LEN {
28252 panic!(
28253 "buffer is too small (need {} bytes, but got {})",
28254 Self::ENCODED_LEN,
28255 __tmp.remaining(),
28256 )
28257 }
28258 __tmp.put_u8(self.severity as u8);
28259 for val in &self.text {
28260 __tmp.put_u8(*val);
28261 }
28262 __tmp.put_u16_le(self.id);
28263 __tmp.put_u8(self.chunk_seq);
28264 if matches!(version, MavlinkVersion::V2) {
28265 let len = __tmp.len();
28266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28267 } else {
28268 __tmp.len()
28269 }
28270 }
28271}
28272#[doc = "id: 261"]
28273#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28274#[derive(Debug, Clone, PartialEq)]
28275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28277pub struct STORAGE_INFORMATION_DATA {
28278 #[doc = "Timestamp (time since system boot)."]
28279 pub time_boot_ms: u32,
28280 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28281 pub total_capacity: f32,
28282 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28283 pub used_capacity: f32,
28284 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28285 pub available_capacity: f32,
28286 #[doc = "Read speed."]
28287 pub read_speed: f32,
28288 #[doc = "Write speed."]
28289 pub write_speed: f32,
28290 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28291 pub storage_id: u8,
28292 #[doc = "Number of storage devices"]
28293 pub storage_count: u8,
28294 #[doc = "Status of storage"]
28295 pub status: StorageStatus,
28296 #[doc = "Type of storage"]
28297 #[cfg_attr(feature = "serde", serde(default))]
28298 pub mavtype: StorageType,
28299 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28300 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28301 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28302 pub name: [u8; 32],
28303 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28304 #[cfg_attr(feature = "serde", serde(default))]
28305 pub storage_usage: StorageUsageFlag,
28306}
28307impl STORAGE_INFORMATION_DATA {
28308 pub const ENCODED_LEN: usize = 61usize;
28309 pub const DEFAULT: Self = Self {
28310 time_boot_ms: 0_u32,
28311 total_capacity: 0.0_f32,
28312 used_capacity: 0.0_f32,
28313 available_capacity: 0.0_f32,
28314 read_speed: 0.0_f32,
28315 write_speed: 0.0_f32,
28316 storage_id: 0_u8,
28317 storage_count: 0_u8,
28318 status: StorageStatus::DEFAULT,
28319 mavtype: StorageType::DEFAULT,
28320 name: [0_u8; 32usize],
28321 storage_usage: StorageUsageFlag::DEFAULT,
28322 };
28323 #[cfg(feature = "arbitrary")]
28324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28325 use arbitrary::{Arbitrary, Unstructured};
28326 let mut buf = [0u8; 1024];
28327 rng.fill_bytes(&mut buf);
28328 let mut unstructured = Unstructured::new(&buf);
28329 Self::arbitrary(&mut unstructured).unwrap_or_default()
28330 }
28331}
28332impl Default for STORAGE_INFORMATION_DATA {
28333 fn default() -> Self {
28334 Self::DEFAULT.clone()
28335 }
28336}
28337impl MessageData for STORAGE_INFORMATION_DATA {
28338 type Message = MavMessage;
28339 const ID: u32 = 261u32;
28340 const NAME: &'static str = "STORAGE_INFORMATION";
28341 const EXTRA_CRC: u8 = 179u8;
28342 const ENCODED_LEN: usize = 61usize;
28343 fn deser(
28344 _version: MavlinkVersion,
28345 __input: &[u8],
28346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28347 let avail_len = __input.len();
28348 let mut payload_buf = [0; Self::ENCODED_LEN];
28349 let mut buf = if avail_len < Self::ENCODED_LEN {
28350 payload_buf[0..avail_len].copy_from_slice(__input);
28351 Bytes::new(&payload_buf)
28352 } else {
28353 Bytes::new(__input)
28354 };
28355 let mut __struct = Self::default();
28356 __struct.time_boot_ms = buf.get_u32_le();
28357 __struct.total_capacity = buf.get_f32_le();
28358 __struct.used_capacity = buf.get_f32_le();
28359 __struct.available_capacity = buf.get_f32_le();
28360 __struct.read_speed = buf.get_f32_le();
28361 __struct.write_speed = buf.get_f32_le();
28362 __struct.storage_id = buf.get_u8();
28363 __struct.storage_count = buf.get_u8();
28364 let tmp = buf.get_u8();
28365 __struct.status =
28366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28367 enum_type: "StorageStatus",
28368 value: tmp as u32,
28369 })?;
28370 let tmp = buf.get_u8();
28371 __struct.mavtype =
28372 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28373 enum_type: "StorageType",
28374 value: tmp as u32,
28375 })?;
28376 for v in &mut __struct.name {
28377 let val = buf.get_u8();
28378 *v = val;
28379 }
28380 let tmp = buf.get_u8();
28381 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28382 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28383 flag_type: "StorageUsageFlag",
28384 value: tmp as u32,
28385 })?;
28386 Ok(__struct)
28387 }
28388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28389 let mut __tmp = BytesMut::new(bytes);
28390 #[allow(clippy::absurd_extreme_comparisons)]
28391 #[allow(unused_comparisons)]
28392 if __tmp.remaining() < Self::ENCODED_LEN {
28393 panic!(
28394 "buffer is too small (need {} bytes, but got {})",
28395 Self::ENCODED_LEN,
28396 __tmp.remaining(),
28397 )
28398 }
28399 __tmp.put_u32_le(self.time_boot_ms);
28400 __tmp.put_f32_le(self.total_capacity);
28401 __tmp.put_f32_le(self.used_capacity);
28402 __tmp.put_f32_le(self.available_capacity);
28403 __tmp.put_f32_le(self.read_speed);
28404 __tmp.put_f32_le(self.write_speed);
28405 __tmp.put_u8(self.storage_id);
28406 __tmp.put_u8(self.storage_count);
28407 __tmp.put_u8(self.status as u8);
28408 __tmp.put_u8(self.mavtype as u8);
28409 for val in &self.name {
28410 __tmp.put_u8(*val);
28411 }
28412 __tmp.put_u8(self.storage_usage.bits());
28413 if matches!(version, MavlinkVersion::V2) {
28414 let len = __tmp.len();
28415 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28416 } else {
28417 __tmp.len()
28418 }
28419 }
28420}
28421#[doc = "id: 401"]
28422#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28423#[derive(Debug, Clone, PartialEq)]
28424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28426pub struct SUPPORTED_TUNES_DATA {
28427 #[doc = "Bitfield of supported tune formats."]
28428 pub format: TuneFormat,
28429 #[doc = "System ID"]
28430 pub target_system: u8,
28431 #[doc = "Component ID"]
28432 pub target_component: u8,
28433}
28434impl SUPPORTED_TUNES_DATA {
28435 pub const ENCODED_LEN: usize = 6usize;
28436 pub const DEFAULT: Self = Self {
28437 format: TuneFormat::DEFAULT,
28438 target_system: 0_u8,
28439 target_component: 0_u8,
28440 };
28441 #[cfg(feature = "arbitrary")]
28442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28443 use arbitrary::{Arbitrary, Unstructured};
28444 let mut buf = [0u8; 1024];
28445 rng.fill_bytes(&mut buf);
28446 let mut unstructured = Unstructured::new(&buf);
28447 Self::arbitrary(&mut unstructured).unwrap_or_default()
28448 }
28449}
28450impl Default for SUPPORTED_TUNES_DATA {
28451 fn default() -> Self {
28452 Self::DEFAULT.clone()
28453 }
28454}
28455impl MessageData for SUPPORTED_TUNES_DATA {
28456 type Message = MavMessage;
28457 const ID: u32 = 401u32;
28458 const NAME: &'static str = "SUPPORTED_TUNES";
28459 const EXTRA_CRC: u8 = 183u8;
28460 const ENCODED_LEN: usize = 6usize;
28461 fn deser(
28462 _version: MavlinkVersion,
28463 __input: &[u8],
28464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28465 let avail_len = __input.len();
28466 let mut payload_buf = [0; Self::ENCODED_LEN];
28467 let mut buf = if avail_len < Self::ENCODED_LEN {
28468 payload_buf[0..avail_len].copy_from_slice(__input);
28469 Bytes::new(&payload_buf)
28470 } else {
28471 Bytes::new(__input)
28472 };
28473 let mut __struct = Self::default();
28474 let tmp = buf.get_u32_le();
28475 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28476 ::mavlink_core::error::ParserError::InvalidEnum {
28477 enum_type: "TuneFormat",
28478 value: tmp as u32,
28479 },
28480 )?;
28481 __struct.target_system = buf.get_u8();
28482 __struct.target_component = buf.get_u8();
28483 Ok(__struct)
28484 }
28485 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28486 let mut __tmp = BytesMut::new(bytes);
28487 #[allow(clippy::absurd_extreme_comparisons)]
28488 #[allow(unused_comparisons)]
28489 if __tmp.remaining() < Self::ENCODED_LEN {
28490 panic!(
28491 "buffer is too small (need {} bytes, but got {})",
28492 Self::ENCODED_LEN,
28493 __tmp.remaining(),
28494 )
28495 }
28496 __tmp.put_u32_le(self.format as u32);
28497 __tmp.put_u8(self.target_system);
28498 __tmp.put_u8(self.target_component);
28499 if matches!(version, MavlinkVersion::V2) {
28500 let len = __tmp.len();
28501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28502 } else {
28503 __tmp.len()
28504 }
28505 }
28506}
28507#[doc = "id: 2"]
28508#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28509#[derive(Debug, Clone, PartialEq)]
28510#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28511#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28512pub struct SYSTEM_TIME_DATA {
28513 #[doc = "Timestamp (UNIX epoch time)."]
28514 pub time_unix_usec: u64,
28515 #[doc = "Timestamp (time since system boot)."]
28516 pub time_boot_ms: u32,
28517}
28518impl SYSTEM_TIME_DATA {
28519 pub const ENCODED_LEN: usize = 12usize;
28520 pub const DEFAULT: Self = Self {
28521 time_unix_usec: 0_u64,
28522 time_boot_ms: 0_u32,
28523 };
28524 #[cfg(feature = "arbitrary")]
28525 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28526 use arbitrary::{Arbitrary, Unstructured};
28527 let mut buf = [0u8; 1024];
28528 rng.fill_bytes(&mut buf);
28529 let mut unstructured = Unstructured::new(&buf);
28530 Self::arbitrary(&mut unstructured).unwrap_or_default()
28531 }
28532}
28533impl Default for SYSTEM_TIME_DATA {
28534 fn default() -> Self {
28535 Self::DEFAULT.clone()
28536 }
28537}
28538impl MessageData for SYSTEM_TIME_DATA {
28539 type Message = MavMessage;
28540 const ID: u32 = 2u32;
28541 const NAME: &'static str = "SYSTEM_TIME";
28542 const EXTRA_CRC: u8 = 137u8;
28543 const ENCODED_LEN: usize = 12usize;
28544 fn deser(
28545 _version: MavlinkVersion,
28546 __input: &[u8],
28547 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28548 let avail_len = __input.len();
28549 let mut payload_buf = [0; Self::ENCODED_LEN];
28550 let mut buf = if avail_len < Self::ENCODED_LEN {
28551 payload_buf[0..avail_len].copy_from_slice(__input);
28552 Bytes::new(&payload_buf)
28553 } else {
28554 Bytes::new(__input)
28555 };
28556 let mut __struct = Self::default();
28557 __struct.time_unix_usec = buf.get_u64_le();
28558 __struct.time_boot_ms = buf.get_u32_le();
28559 Ok(__struct)
28560 }
28561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28562 let mut __tmp = BytesMut::new(bytes);
28563 #[allow(clippy::absurd_extreme_comparisons)]
28564 #[allow(unused_comparisons)]
28565 if __tmp.remaining() < Self::ENCODED_LEN {
28566 panic!(
28567 "buffer is too small (need {} bytes, but got {})",
28568 Self::ENCODED_LEN,
28569 __tmp.remaining(),
28570 )
28571 }
28572 __tmp.put_u64_le(self.time_unix_usec);
28573 __tmp.put_u32_le(self.time_boot_ms);
28574 if matches!(version, MavlinkVersion::V2) {
28575 let len = __tmp.len();
28576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28577 } else {
28578 __tmp.len()
28579 }
28580 }
28581}
28582#[doc = "id: 1"]
28583#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28584#[derive(Debug, Clone, PartialEq)]
28585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28587pub struct SYS_STATUS_DATA {
28588 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28589 pub onboard_control_sensors_present: MavSysStatusSensor,
28590 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28591 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28592 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28593 pub onboard_control_sensors_health: MavSysStatusSensor,
28594 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28595 pub load: u16,
28596 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28597 pub voltage_battery: u16,
28598 #[doc = "Battery current, -1: Current not sent by autopilot"]
28599 pub current_battery: i16,
28600 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28601 pub drop_rate_comm: u16,
28602 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28603 pub errors_comm: u16,
28604 #[doc = "Autopilot-specific errors"]
28605 pub errors_count1: u16,
28606 #[doc = "Autopilot-specific errors"]
28607 pub errors_count2: u16,
28608 #[doc = "Autopilot-specific errors"]
28609 pub errors_count3: u16,
28610 #[doc = "Autopilot-specific errors"]
28611 pub errors_count4: u16,
28612 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28613 pub battery_remaining: i8,
28614 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28615 #[cfg_attr(feature = "serde", serde(default))]
28616 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28617 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28618 #[cfg_attr(feature = "serde", serde(default))]
28619 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28620 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28621 #[cfg_attr(feature = "serde", serde(default))]
28622 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28623}
28624impl SYS_STATUS_DATA {
28625 pub const ENCODED_LEN: usize = 43usize;
28626 pub const DEFAULT: Self = Self {
28627 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28628 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28629 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28630 load: 0_u16,
28631 voltage_battery: 0_u16,
28632 current_battery: 0_i16,
28633 drop_rate_comm: 0_u16,
28634 errors_comm: 0_u16,
28635 errors_count1: 0_u16,
28636 errors_count2: 0_u16,
28637 errors_count3: 0_u16,
28638 errors_count4: 0_u16,
28639 battery_remaining: 0_i8,
28640 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28641 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28642 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28643 };
28644 #[cfg(feature = "arbitrary")]
28645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28646 use arbitrary::{Arbitrary, Unstructured};
28647 let mut buf = [0u8; 1024];
28648 rng.fill_bytes(&mut buf);
28649 let mut unstructured = Unstructured::new(&buf);
28650 Self::arbitrary(&mut unstructured).unwrap_or_default()
28651 }
28652}
28653impl Default for SYS_STATUS_DATA {
28654 fn default() -> Self {
28655 Self::DEFAULT.clone()
28656 }
28657}
28658impl MessageData for SYS_STATUS_DATA {
28659 type Message = MavMessage;
28660 const ID: u32 = 1u32;
28661 const NAME: &'static str = "SYS_STATUS";
28662 const EXTRA_CRC: u8 = 124u8;
28663 const ENCODED_LEN: usize = 43usize;
28664 fn deser(
28665 _version: MavlinkVersion,
28666 __input: &[u8],
28667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28668 let avail_len = __input.len();
28669 let mut payload_buf = [0; Self::ENCODED_LEN];
28670 let mut buf = if avail_len < Self::ENCODED_LEN {
28671 payload_buf[0..avail_len].copy_from_slice(__input);
28672 Bytes::new(&payload_buf)
28673 } else {
28674 Bytes::new(__input)
28675 };
28676 let mut __struct = Self::default();
28677 let tmp = buf.get_u32_le();
28678 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28679 tmp & MavSysStatusSensor::all().bits(),
28680 )
28681 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28682 flag_type: "MavSysStatusSensor",
28683 value: tmp as u32,
28684 })?;
28685 let tmp = buf.get_u32_le();
28686 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28687 tmp & MavSysStatusSensor::all().bits(),
28688 )
28689 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28690 flag_type: "MavSysStatusSensor",
28691 value: tmp as u32,
28692 })?;
28693 let tmp = buf.get_u32_le();
28694 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28695 tmp & MavSysStatusSensor::all().bits(),
28696 )
28697 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28698 flag_type: "MavSysStatusSensor",
28699 value: tmp as u32,
28700 })?;
28701 __struct.load = buf.get_u16_le();
28702 __struct.voltage_battery = buf.get_u16_le();
28703 __struct.current_battery = buf.get_i16_le();
28704 __struct.drop_rate_comm = buf.get_u16_le();
28705 __struct.errors_comm = buf.get_u16_le();
28706 __struct.errors_count1 = buf.get_u16_le();
28707 __struct.errors_count2 = buf.get_u16_le();
28708 __struct.errors_count3 = buf.get_u16_le();
28709 __struct.errors_count4 = buf.get_u16_le();
28710 __struct.battery_remaining = buf.get_i8();
28711 let tmp = buf.get_u32_le();
28712 __struct.onboard_control_sensors_present_extended =
28713 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28714 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28715 flag_type: "MavSysStatusSensorExtended",
28716 value: tmp as u32,
28717 })?;
28718 let tmp = buf.get_u32_le();
28719 __struct.onboard_control_sensors_enabled_extended =
28720 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28721 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28722 flag_type: "MavSysStatusSensorExtended",
28723 value: tmp as u32,
28724 })?;
28725 let tmp = buf.get_u32_le();
28726 __struct.onboard_control_sensors_health_extended =
28727 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28728 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28729 flag_type: "MavSysStatusSensorExtended",
28730 value: tmp as u32,
28731 })?;
28732 Ok(__struct)
28733 }
28734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28735 let mut __tmp = BytesMut::new(bytes);
28736 #[allow(clippy::absurd_extreme_comparisons)]
28737 #[allow(unused_comparisons)]
28738 if __tmp.remaining() < Self::ENCODED_LEN {
28739 panic!(
28740 "buffer is too small (need {} bytes, but got {})",
28741 Self::ENCODED_LEN,
28742 __tmp.remaining(),
28743 )
28744 }
28745 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28746 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28747 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28748 __tmp.put_u16_le(self.load);
28749 __tmp.put_u16_le(self.voltage_battery);
28750 __tmp.put_i16_le(self.current_battery);
28751 __tmp.put_u16_le(self.drop_rate_comm);
28752 __tmp.put_u16_le(self.errors_comm);
28753 __tmp.put_u16_le(self.errors_count1);
28754 __tmp.put_u16_le(self.errors_count2);
28755 __tmp.put_u16_le(self.errors_count3);
28756 __tmp.put_u16_le(self.errors_count4);
28757 __tmp.put_i8(self.battery_remaining);
28758 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28759 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28760 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28761 if matches!(version, MavlinkVersion::V2) {
28762 let len = __tmp.len();
28763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28764 } else {
28765 __tmp.len()
28766 }
28767 }
28768}
28769#[doc = "id: 135"]
28770#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28771#[derive(Debug, Clone, PartialEq)]
28772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28773#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28774pub struct TERRAIN_CHECK_DATA {
28775 #[doc = "Latitude"]
28776 pub lat: i32,
28777 #[doc = "Longitude"]
28778 pub lon: i32,
28779}
28780impl TERRAIN_CHECK_DATA {
28781 pub const ENCODED_LEN: usize = 8usize;
28782 pub const DEFAULT: Self = Self {
28783 lat: 0_i32,
28784 lon: 0_i32,
28785 };
28786 #[cfg(feature = "arbitrary")]
28787 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28788 use arbitrary::{Arbitrary, Unstructured};
28789 let mut buf = [0u8; 1024];
28790 rng.fill_bytes(&mut buf);
28791 let mut unstructured = Unstructured::new(&buf);
28792 Self::arbitrary(&mut unstructured).unwrap_or_default()
28793 }
28794}
28795impl Default for TERRAIN_CHECK_DATA {
28796 fn default() -> Self {
28797 Self::DEFAULT.clone()
28798 }
28799}
28800impl MessageData for TERRAIN_CHECK_DATA {
28801 type Message = MavMessage;
28802 const ID: u32 = 135u32;
28803 const NAME: &'static str = "TERRAIN_CHECK";
28804 const EXTRA_CRC: u8 = 203u8;
28805 const ENCODED_LEN: usize = 8usize;
28806 fn deser(
28807 _version: MavlinkVersion,
28808 __input: &[u8],
28809 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28810 let avail_len = __input.len();
28811 let mut payload_buf = [0; Self::ENCODED_LEN];
28812 let mut buf = if avail_len < Self::ENCODED_LEN {
28813 payload_buf[0..avail_len].copy_from_slice(__input);
28814 Bytes::new(&payload_buf)
28815 } else {
28816 Bytes::new(__input)
28817 };
28818 let mut __struct = Self::default();
28819 __struct.lat = buf.get_i32_le();
28820 __struct.lon = buf.get_i32_le();
28821 Ok(__struct)
28822 }
28823 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28824 let mut __tmp = BytesMut::new(bytes);
28825 #[allow(clippy::absurd_extreme_comparisons)]
28826 #[allow(unused_comparisons)]
28827 if __tmp.remaining() < Self::ENCODED_LEN {
28828 panic!(
28829 "buffer is too small (need {} bytes, but got {})",
28830 Self::ENCODED_LEN,
28831 __tmp.remaining(),
28832 )
28833 }
28834 __tmp.put_i32_le(self.lat);
28835 __tmp.put_i32_le(self.lon);
28836 if matches!(version, MavlinkVersion::V2) {
28837 let len = __tmp.len();
28838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28839 } else {
28840 __tmp.len()
28841 }
28842 }
28843}
28844#[doc = "id: 134"]
28845#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28846#[derive(Debug, Clone, PartialEq)]
28847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28849pub struct TERRAIN_DATA_DATA {
28850 #[doc = "Latitude of SW corner of first grid"]
28851 pub lat: i32,
28852 #[doc = "Longitude of SW corner of first grid"]
28853 pub lon: i32,
28854 #[doc = "Grid spacing"]
28855 pub grid_spacing: u16,
28856 #[doc = "Terrain data MSL"]
28857 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28858 pub data: [i16; 16],
28859 #[doc = "bit within the terrain request mask"]
28860 pub gridbit: u8,
28861}
28862impl TERRAIN_DATA_DATA {
28863 pub const ENCODED_LEN: usize = 43usize;
28864 pub const DEFAULT: Self = Self {
28865 lat: 0_i32,
28866 lon: 0_i32,
28867 grid_spacing: 0_u16,
28868 data: [0_i16; 16usize],
28869 gridbit: 0_u8,
28870 };
28871 #[cfg(feature = "arbitrary")]
28872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28873 use arbitrary::{Arbitrary, Unstructured};
28874 let mut buf = [0u8; 1024];
28875 rng.fill_bytes(&mut buf);
28876 let mut unstructured = Unstructured::new(&buf);
28877 Self::arbitrary(&mut unstructured).unwrap_or_default()
28878 }
28879}
28880impl Default for TERRAIN_DATA_DATA {
28881 fn default() -> Self {
28882 Self::DEFAULT.clone()
28883 }
28884}
28885impl MessageData for TERRAIN_DATA_DATA {
28886 type Message = MavMessage;
28887 const ID: u32 = 134u32;
28888 const NAME: &'static str = "TERRAIN_DATA";
28889 const EXTRA_CRC: u8 = 229u8;
28890 const ENCODED_LEN: usize = 43usize;
28891 fn deser(
28892 _version: MavlinkVersion,
28893 __input: &[u8],
28894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28895 let avail_len = __input.len();
28896 let mut payload_buf = [0; Self::ENCODED_LEN];
28897 let mut buf = if avail_len < Self::ENCODED_LEN {
28898 payload_buf[0..avail_len].copy_from_slice(__input);
28899 Bytes::new(&payload_buf)
28900 } else {
28901 Bytes::new(__input)
28902 };
28903 let mut __struct = Self::default();
28904 __struct.lat = buf.get_i32_le();
28905 __struct.lon = buf.get_i32_le();
28906 __struct.grid_spacing = buf.get_u16_le();
28907 for v in &mut __struct.data {
28908 let val = buf.get_i16_le();
28909 *v = val;
28910 }
28911 __struct.gridbit = buf.get_u8();
28912 Ok(__struct)
28913 }
28914 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28915 let mut __tmp = BytesMut::new(bytes);
28916 #[allow(clippy::absurd_extreme_comparisons)]
28917 #[allow(unused_comparisons)]
28918 if __tmp.remaining() < Self::ENCODED_LEN {
28919 panic!(
28920 "buffer is too small (need {} bytes, but got {})",
28921 Self::ENCODED_LEN,
28922 __tmp.remaining(),
28923 )
28924 }
28925 __tmp.put_i32_le(self.lat);
28926 __tmp.put_i32_le(self.lon);
28927 __tmp.put_u16_le(self.grid_spacing);
28928 for val in &self.data {
28929 __tmp.put_i16_le(*val);
28930 }
28931 __tmp.put_u8(self.gridbit);
28932 if matches!(version, MavlinkVersion::V2) {
28933 let len = __tmp.len();
28934 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28935 } else {
28936 __tmp.len()
28937 }
28938 }
28939}
28940#[doc = "id: 136"]
28941#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28942#[derive(Debug, Clone, PartialEq)]
28943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28944#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28945pub struct TERRAIN_REPORT_DATA {
28946 #[doc = "Latitude"]
28947 pub lat: i32,
28948 #[doc = "Longitude"]
28949 pub lon: i32,
28950 #[doc = "Terrain height MSL"]
28951 pub terrain_height: f32,
28952 #[doc = "Current vehicle height above lat/lon terrain height"]
28953 pub current_height: f32,
28954 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
28955 pub spacing: u16,
28956 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
28957 pub pending: u16,
28958 #[doc = "Number of 4x4 terrain blocks in memory"]
28959 pub loaded: u16,
28960}
28961impl TERRAIN_REPORT_DATA {
28962 pub const ENCODED_LEN: usize = 22usize;
28963 pub const DEFAULT: Self = Self {
28964 lat: 0_i32,
28965 lon: 0_i32,
28966 terrain_height: 0.0_f32,
28967 current_height: 0.0_f32,
28968 spacing: 0_u16,
28969 pending: 0_u16,
28970 loaded: 0_u16,
28971 };
28972 #[cfg(feature = "arbitrary")]
28973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28974 use arbitrary::{Arbitrary, Unstructured};
28975 let mut buf = [0u8; 1024];
28976 rng.fill_bytes(&mut buf);
28977 let mut unstructured = Unstructured::new(&buf);
28978 Self::arbitrary(&mut unstructured).unwrap_or_default()
28979 }
28980}
28981impl Default for TERRAIN_REPORT_DATA {
28982 fn default() -> Self {
28983 Self::DEFAULT.clone()
28984 }
28985}
28986impl MessageData for TERRAIN_REPORT_DATA {
28987 type Message = MavMessage;
28988 const ID: u32 = 136u32;
28989 const NAME: &'static str = "TERRAIN_REPORT";
28990 const EXTRA_CRC: u8 = 1u8;
28991 const ENCODED_LEN: usize = 22usize;
28992 fn deser(
28993 _version: MavlinkVersion,
28994 __input: &[u8],
28995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28996 let avail_len = __input.len();
28997 let mut payload_buf = [0; Self::ENCODED_LEN];
28998 let mut buf = if avail_len < Self::ENCODED_LEN {
28999 payload_buf[0..avail_len].copy_from_slice(__input);
29000 Bytes::new(&payload_buf)
29001 } else {
29002 Bytes::new(__input)
29003 };
29004 let mut __struct = Self::default();
29005 __struct.lat = buf.get_i32_le();
29006 __struct.lon = buf.get_i32_le();
29007 __struct.terrain_height = buf.get_f32_le();
29008 __struct.current_height = buf.get_f32_le();
29009 __struct.spacing = buf.get_u16_le();
29010 __struct.pending = buf.get_u16_le();
29011 __struct.loaded = buf.get_u16_le();
29012 Ok(__struct)
29013 }
29014 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29015 let mut __tmp = BytesMut::new(bytes);
29016 #[allow(clippy::absurd_extreme_comparisons)]
29017 #[allow(unused_comparisons)]
29018 if __tmp.remaining() < Self::ENCODED_LEN {
29019 panic!(
29020 "buffer is too small (need {} bytes, but got {})",
29021 Self::ENCODED_LEN,
29022 __tmp.remaining(),
29023 )
29024 }
29025 __tmp.put_i32_le(self.lat);
29026 __tmp.put_i32_le(self.lon);
29027 __tmp.put_f32_le(self.terrain_height);
29028 __tmp.put_f32_le(self.current_height);
29029 __tmp.put_u16_le(self.spacing);
29030 __tmp.put_u16_le(self.pending);
29031 __tmp.put_u16_le(self.loaded);
29032 if matches!(version, MavlinkVersion::V2) {
29033 let len = __tmp.len();
29034 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29035 } else {
29036 __tmp.len()
29037 }
29038 }
29039}
29040#[doc = "id: 133"]
29041#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29042#[derive(Debug, Clone, PartialEq)]
29043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29045pub struct TERRAIN_REQUEST_DATA {
29046 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29047 pub mask: u64,
29048 #[doc = "Latitude of SW corner of first grid"]
29049 pub lat: i32,
29050 #[doc = "Longitude of SW corner of first grid"]
29051 pub lon: i32,
29052 #[doc = "Grid spacing"]
29053 pub grid_spacing: u16,
29054}
29055impl TERRAIN_REQUEST_DATA {
29056 pub const ENCODED_LEN: usize = 18usize;
29057 pub const DEFAULT: Self = Self {
29058 mask: 0_u64,
29059 lat: 0_i32,
29060 lon: 0_i32,
29061 grid_spacing: 0_u16,
29062 };
29063 #[cfg(feature = "arbitrary")]
29064 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29065 use arbitrary::{Arbitrary, Unstructured};
29066 let mut buf = [0u8; 1024];
29067 rng.fill_bytes(&mut buf);
29068 let mut unstructured = Unstructured::new(&buf);
29069 Self::arbitrary(&mut unstructured).unwrap_or_default()
29070 }
29071}
29072impl Default for TERRAIN_REQUEST_DATA {
29073 fn default() -> Self {
29074 Self::DEFAULT.clone()
29075 }
29076}
29077impl MessageData for TERRAIN_REQUEST_DATA {
29078 type Message = MavMessage;
29079 const ID: u32 = 133u32;
29080 const NAME: &'static str = "TERRAIN_REQUEST";
29081 const EXTRA_CRC: u8 = 6u8;
29082 const ENCODED_LEN: usize = 18usize;
29083 fn deser(
29084 _version: MavlinkVersion,
29085 __input: &[u8],
29086 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29087 let avail_len = __input.len();
29088 let mut payload_buf = [0; Self::ENCODED_LEN];
29089 let mut buf = if avail_len < Self::ENCODED_LEN {
29090 payload_buf[0..avail_len].copy_from_slice(__input);
29091 Bytes::new(&payload_buf)
29092 } else {
29093 Bytes::new(__input)
29094 };
29095 let mut __struct = Self::default();
29096 __struct.mask = buf.get_u64_le();
29097 __struct.lat = buf.get_i32_le();
29098 __struct.lon = buf.get_i32_le();
29099 __struct.grid_spacing = buf.get_u16_le();
29100 Ok(__struct)
29101 }
29102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29103 let mut __tmp = BytesMut::new(bytes);
29104 #[allow(clippy::absurd_extreme_comparisons)]
29105 #[allow(unused_comparisons)]
29106 if __tmp.remaining() < Self::ENCODED_LEN {
29107 panic!(
29108 "buffer is too small (need {} bytes, but got {})",
29109 Self::ENCODED_LEN,
29110 __tmp.remaining(),
29111 )
29112 }
29113 __tmp.put_u64_le(self.mask);
29114 __tmp.put_i32_le(self.lat);
29115 __tmp.put_i32_le(self.lon);
29116 __tmp.put_u16_le(self.grid_spacing);
29117 if matches!(version, MavlinkVersion::V2) {
29118 let len = __tmp.len();
29119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29120 } else {
29121 __tmp.len()
29122 }
29123 }
29124}
29125#[doc = "id: 111"]
29126#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29127#[derive(Debug, Clone, PartialEq)]
29128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29129#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29130pub struct TIMESYNC_DATA {
29131 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29132 pub tc1: i64,
29133 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29134 pub ts1: i64,
29135 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29136 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29137 pub target_system: u8,
29138 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29140 pub target_component: u8,
29141}
29142impl TIMESYNC_DATA {
29143 pub const ENCODED_LEN: usize = 18usize;
29144 pub const DEFAULT: Self = Self {
29145 tc1: 0_i64,
29146 ts1: 0_i64,
29147 target_system: 0_u8,
29148 target_component: 0_u8,
29149 };
29150 #[cfg(feature = "arbitrary")]
29151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29152 use arbitrary::{Arbitrary, Unstructured};
29153 let mut buf = [0u8; 1024];
29154 rng.fill_bytes(&mut buf);
29155 let mut unstructured = Unstructured::new(&buf);
29156 Self::arbitrary(&mut unstructured).unwrap_or_default()
29157 }
29158}
29159impl Default for TIMESYNC_DATA {
29160 fn default() -> Self {
29161 Self::DEFAULT.clone()
29162 }
29163}
29164impl MessageData for TIMESYNC_DATA {
29165 type Message = MavMessage;
29166 const ID: u32 = 111u32;
29167 const NAME: &'static str = "TIMESYNC";
29168 const EXTRA_CRC: u8 = 34u8;
29169 const ENCODED_LEN: usize = 18usize;
29170 fn deser(
29171 _version: MavlinkVersion,
29172 __input: &[u8],
29173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29174 let avail_len = __input.len();
29175 let mut payload_buf = [0; Self::ENCODED_LEN];
29176 let mut buf = if avail_len < Self::ENCODED_LEN {
29177 payload_buf[0..avail_len].copy_from_slice(__input);
29178 Bytes::new(&payload_buf)
29179 } else {
29180 Bytes::new(__input)
29181 };
29182 let mut __struct = Self::default();
29183 __struct.tc1 = buf.get_i64_le();
29184 __struct.ts1 = buf.get_i64_le();
29185 __struct.target_system = buf.get_u8();
29186 __struct.target_component = buf.get_u8();
29187 Ok(__struct)
29188 }
29189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29190 let mut __tmp = BytesMut::new(bytes);
29191 #[allow(clippy::absurd_extreme_comparisons)]
29192 #[allow(unused_comparisons)]
29193 if __tmp.remaining() < Self::ENCODED_LEN {
29194 panic!(
29195 "buffer is too small (need {} bytes, but got {})",
29196 Self::ENCODED_LEN,
29197 __tmp.remaining(),
29198 )
29199 }
29200 __tmp.put_i64_le(self.tc1);
29201 __tmp.put_i64_le(self.ts1);
29202 __tmp.put_u8(self.target_system);
29203 __tmp.put_u8(self.target_component);
29204 if matches!(version, MavlinkVersion::V2) {
29205 let len = __tmp.len();
29206 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29207 } else {
29208 __tmp.len()
29209 }
29210 }
29211}
29212#[doc = "id: 380"]
29213#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29214#[derive(Debug, Clone, PartialEq)]
29215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29217pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29218 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29219 pub safe_return: i32,
29220 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29221 pub land: i32,
29222 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29223 pub mission_next_item: i32,
29224 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29225 pub mission_end: i32,
29226 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29227 pub commanded_action: i32,
29228}
29229impl TIME_ESTIMATE_TO_TARGET_DATA {
29230 pub const ENCODED_LEN: usize = 20usize;
29231 pub const DEFAULT: Self = Self {
29232 safe_return: 0_i32,
29233 land: 0_i32,
29234 mission_next_item: 0_i32,
29235 mission_end: 0_i32,
29236 commanded_action: 0_i32,
29237 };
29238 #[cfg(feature = "arbitrary")]
29239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29240 use arbitrary::{Arbitrary, Unstructured};
29241 let mut buf = [0u8; 1024];
29242 rng.fill_bytes(&mut buf);
29243 let mut unstructured = Unstructured::new(&buf);
29244 Self::arbitrary(&mut unstructured).unwrap_or_default()
29245 }
29246}
29247impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29248 fn default() -> Self {
29249 Self::DEFAULT.clone()
29250 }
29251}
29252impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29253 type Message = MavMessage;
29254 const ID: u32 = 380u32;
29255 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29256 const EXTRA_CRC: u8 = 232u8;
29257 const ENCODED_LEN: usize = 20usize;
29258 fn deser(
29259 _version: MavlinkVersion,
29260 __input: &[u8],
29261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29262 let avail_len = __input.len();
29263 let mut payload_buf = [0; Self::ENCODED_LEN];
29264 let mut buf = if avail_len < Self::ENCODED_LEN {
29265 payload_buf[0..avail_len].copy_from_slice(__input);
29266 Bytes::new(&payload_buf)
29267 } else {
29268 Bytes::new(__input)
29269 };
29270 let mut __struct = Self::default();
29271 __struct.safe_return = buf.get_i32_le();
29272 __struct.land = buf.get_i32_le();
29273 __struct.mission_next_item = buf.get_i32_le();
29274 __struct.mission_end = buf.get_i32_le();
29275 __struct.commanded_action = buf.get_i32_le();
29276 Ok(__struct)
29277 }
29278 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29279 let mut __tmp = BytesMut::new(bytes);
29280 #[allow(clippy::absurd_extreme_comparisons)]
29281 #[allow(unused_comparisons)]
29282 if __tmp.remaining() < Self::ENCODED_LEN {
29283 panic!(
29284 "buffer is too small (need {} bytes, but got {})",
29285 Self::ENCODED_LEN,
29286 __tmp.remaining(),
29287 )
29288 }
29289 __tmp.put_i32_le(self.safe_return);
29290 __tmp.put_i32_le(self.land);
29291 __tmp.put_i32_le(self.mission_next_item);
29292 __tmp.put_i32_le(self.mission_end);
29293 __tmp.put_i32_le(self.commanded_action);
29294 if matches!(version, MavlinkVersion::V2) {
29295 let len = __tmp.len();
29296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29297 } else {
29298 __tmp.len()
29299 }
29300 }
29301}
29302#[doc = "id: 333"]
29303#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29304#[derive(Debug, Clone, PartialEq)]
29305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29307pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29308 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29309 pub time_usec: u64,
29310 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29311 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29312 pub pos_x: [f32; 5],
29313 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29315 pub pos_y: [f32; 5],
29316 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29317 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29318 pub pos_z: [f32; 5],
29319 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29321 pub delta: [f32; 5],
29322 #[doc = "Yaw. Set to NaN for unchanged"]
29323 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29324 pub pos_yaw: [f32; 5],
29325 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29326 pub valid_points: u8,
29327}
29328impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29329 pub const ENCODED_LEN: usize = 109usize;
29330 pub const DEFAULT: Self = Self {
29331 time_usec: 0_u64,
29332 pos_x: [0.0_f32; 5usize],
29333 pos_y: [0.0_f32; 5usize],
29334 pos_z: [0.0_f32; 5usize],
29335 delta: [0.0_f32; 5usize],
29336 pos_yaw: [0.0_f32; 5usize],
29337 valid_points: 0_u8,
29338 };
29339 #[cfg(feature = "arbitrary")]
29340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29341 use arbitrary::{Arbitrary, Unstructured};
29342 let mut buf = [0u8; 1024];
29343 rng.fill_bytes(&mut buf);
29344 let mut unstructured = Unstructured::new(&buf);
29345 Self::arbitrary(&mut unstructured).unwrap_or_default()
29346 }
29347}
29348impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29349 fn default() -> Self {
29350 Self::DEFAULT.clone()
29351 }
29352}
29353impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29354 type Message = MavMessage;
29355 const ID: u32 = 333u32;
29356 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29357 const EXTRA_CRC: u8 = 231u8;
29358 const ENCODED_LEN: usize = 109usize;
29359 fn deser(
29360 _version: MavlinkVersion,
29361 __input: &[u8],
29362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29363 let avail_len = __input.len();
29364 let mut payload_buf = [0; Self::ENCODED_LEN];
29365 let mut buf = if avail_len < Self::ENCODED_LEN {
29366 payload_buf[0..avail_len].copy_from_slice(__input);
29367 Bytes::new(&payload_buf)
29368 } else {
29369 Bytes::new(__input)
29370 };
29371 let mut __struct = Self::default();
29372 __struct.time_usec = buf.get_u64_le();
29373 for v in &mut __struct.pos_x {
29374 let val = buf.get_f32_le();
29375 *v = val;
29376 }
29377 for v in &mut __struct.pos_y {
29378 let val = buf.get_f32_le();
29379 *v = val;
29380 }
29381 for v in &mut __struct.pos_z {
29382 let val = buf.get_f32_le();
29383 *v = val;
29384 }
29385 for v in &mut __struct.delta {
29386 let val = buf.get_f32_le();
29387 *v = val;
29388 }
29389 for v in &mut __struct.pos_yaw {
29390 let val = buf.get_f32_le();
29391 *v = val;
29392 }
29393 __struct.valid_points = buf.get_u8();
29394 Ok(__struct)
29395 }
29396 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29397 let mut __tmp = BytesMut::new(bytes);
29398 #[allow(clippy::absurd_extreme_comparisons)]
29399 #[allow(unused_comparisons)]
29400 if __tmp.remaining() < Self::ENCODED_LEN {
29401 panic!(
29402 "buffer is too small (need {} bytes, but got {})",
29403 Self::ENCODED_LEN,
29404 __tmp.remaining(),
29405 )
29406 }
29407 __tmp.put_u64_le(self.time_usec);
29408 for val in &self.pos_x {
29409 __tmp.put_f32_le(*val);
29410 }
29411 for val in &self.pos_y {
29412 __tmp.put_f32_le(*val);
29413 }
29414 for val in &self.pos_z {
29415 __tmp.put_f32_le(*val);
29416 }
29417 for val in &self.delta {
29418 __tmp.put_f32_le(*val);
29419 }
29420 for val in &self.pos_yaw {
29421 __tmp.put_f32_le(*val);
29422 }
29423 __tmp.put_u8(self.valid_points);
29424 if matches!(version, MavlinkVersion::V2) {
29425 let len = __tmp.len();
29426 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29427 } else {
29428 __tmp.len()
29429 }
29430 }
29431}
29432#[doc = "id: 332"]
29433#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29434#[derive(Debug, Clone, PartialEq)]
29435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29437pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29438 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29439 pub time_usec: u64,
29440 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29441 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29442 pub pos_x: [f32; 5],
29443 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29445 pub pos_y: [f32; 5],
29446 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29447 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29448 pub pos_z: [f32; 5],
29449 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29451 pub vel_x: [f32; 5],
29452 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29453 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29454 pub vel_y: [f32; 5],
29455 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29456 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29457 pub vel_z: [f32; 5],
29458 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29459 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29460 pub acc_x: [f32; 5],
29461 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29462 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29463 pub acc_y: [f32; 5],
29464 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29465 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29466 pub acc_z: [f32; 5],
29467 #[doc = "Yaw angle, set to NaN if not being used"]
29468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29469 pub pos_yaw: [f32; 5],
29470 #[doc = "Yaw rate, set to NaN if not being used"]
29471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29472 pub vel_yaw: [f32; 5],
29473 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29475 pub command: [u16; 5],
29476 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29477 pub valid_points: u8,
29478}
29479impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29480 pub const ENCODED_LEN: usize = 239usize;
29481 pub const DEFAULT: Self = Self {
29482 time_usec: 0_u64,
29483 pos_x: [0.0_f32; 5usize],
29484 pos_y: [0.0_f32; 5usize],
29485 pos_z: [0.0_f32; 5usize],
29486 vel_x: [0.0_f32; 5usize],
29487 vel_y: [0.0_f32; 5usize],
29488 vel_z: [0.0_f32; 5usize],
29489 acc_x: [0.0_f32; 5usize],
29490 acc_y: [0.0_f32; 5usize],
29491 acc_z: [0.0_f32; 5usize],
29492 pos_yaw: [0.0_f32; 5usize],
29493 vel_yaw: [0.0_f32; 5usize],
29494 command: [0_u16; 5usize],
29495 valid_points: 0_u8,
29496 };
29497 #[cfg(feature = "arbitrary")]
29498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29499 use arbitrary::{Arbitrary, Unstructured};
29500 let mut buf = [0u8; 1024];
29501 rng.fill_bytes(&mut buf);
29502 let mut unstructured = Unstructured::new(&buf);
29503 Self::arbitrary(&mut unstructured).unwrap_or_default()
29504 }
29505}
29506impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29507 fn default() -> Self {
29508 Self::DEFAULT.clone()
29509 }
29510}
29511impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29512 type Message = MavMessage;
29513 const ID: u32 = 332u32;
29514 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29515 const EXTRA_CRC: u8 = 236u8;
29516 const ENCODED_LEN: usize = 239usize;
29517 fn deser(
29518 _version: MavlinkVersion,
29519 __input: &[u8],
29520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29521 let avail_len = __input.len();
29522 let mut payload_buf = [0; Self::ENCODED_LEN];
29523 let mut buf = if avail_len < Self::ENCODED_LEN {
29524 payload_buf[0..avail_len].copy_from_slice(__input);
29525 Bytes::new(&payload_buf)
29526 } else {
29527 Bytes::new(__input)
29528 };
29529 let mut __struct = Self::default();
29530 __struct.time_usec = buf.get_u64_le();
29531 for v in &mut __struct.pos_x {
29532 let val = buf.get_f32_le();
29533 *v = val;
29534 }
29535 for v in &mut __struct.pos_y {
29536 let val = buf.get_f32_le();
29537 *v = val;
29538 }
29539 for v in &mut __struct.pos_z {
29540 let val = buf.get_f32_le();
29541 *v = val;
29542 }
29543 for v in &mut __struct.vel_x {
29544 let val = buf.get_f32_le();
29545 *v = val;
29546 }
29547 for v in &mut __struct.vel_y {
29548 let val = buf.get_f32_le();
29549 *v = val;
29550 }
29551 for v in &mut __struct.vel_z {
29552 let val = buf.get_f32_le();
29553 *v = val;
29554 }
29555 for v in &mut __struct.acc_x {
29556 let val = buf.get_f32_le();
29557 *v = val;
29558 }
29559 for v in &mut __struct.acc_y {
29560 let val = buf.get_f32_le();
29561 *v = val;
29562 }
29563 for v in &mut __struct.acc_z {
29564 let val = buf.get_f32_le();
29565 *v = val;
29566 }
29567 for v in &mut __struct.pos_yaw {
29568 let val = buf.get_f32_le();
29569 *v = val;
29570 }
29571 for v in &mut __struct.vel_yaw {
29572 let val = buf.get_f32_le();
29573 *v = val;
29574 }
29575 for v in &mut __struct.command {
29576 let val = buf.get_u16_le();
29577 *v = val;
29578 }
29579 __struct.valid_points = buf.get_u8();
29580 Ok(__struct)
29581 }
29582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29583 let mut __tmp = BytesMut::new(bytes);
29584 #[allow(clippy::absurd_extreme_comparisons)]
29585 #[allow(unused_comparisons)]
29586 if __tmp.remaining() < Self::ENCODED_LEN {
29587 panic!(
29588 "buffer is too small (need {} bytes, but got {})",
29589 Self::ENCODED_LEN,
29590 __tmp.remaining(),
29591 )
29592 }
29593 __tmp.put_u64_le(self.time_usec);
29594 for val in &self.pos_x {
29595 __tmp.put_f32_le(*val);
29596 }
29597 for val in &self.pos_y {
29598 __tmp.put_f32_le(*val);
29599 }
29600 for val in &self.pos_z {
29601 __tmp.put_f32_le(*val);
29602 }
29603 for val in &self.vel_x {
29604 __tmp.put_f32_le(*val);
29605 }
29606 for val in &self.vel_y {
29607 __tmp.put_f32_le(*val);
29608 }
29609 for val in &self.vel_z {
29610 __tmp.put_f32_le(*val);
29611 }
29612 for val in &self.acc_x {
29613 __tmp.put_f32_le(*val);
29614 }
29615 for val in &self.acc_y {
29616 __tmp.put_f32_le(*val);
29617 }
29618 for val in &self.acc_z {
29619 __tmp.put_f32_le(*val);
29620 }
29621 for val in &self.pos_yaw {
29622 __tmp.put_f32_le(*val);
29623 }
29624 for val in &self.vel_yaw {
29625 __tmp.put_f32_le(*val);
29626 }
29627 for val in &self.command {
29628 __tmp.put_u16_le(*val);
29629 }
29630 __tmp.put_u8(self.valid_points);
29631 if matches!(version, MavlinkVersion::V2) {
29632 let len = __tmp.len();
29633 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29634 } else {
29635 __tmp.len()
29636 }
29637 }
29638}
29639#[doc = "id: 385"]
29640#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29641#[derive(Debug, Clone, PartialEq)]
29642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29644pub struct TUNNEL_DATA {
29645 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29646 pub payload_type: MavTunnelPayloadType,
29647 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29648 pub target_system: u8,
29649 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29650 pub target_component: u8,
29651 #[doc = "Length of the data transported in payload"]
29652 pub payload_length: u8,
29653 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29655 pub payload: [u8; 128],
29656}
29657impl TUNNEL_DATA {
29658 pub const ENCODED_LEN: usize = 133usize;
29659 pub const DEFAULT: Self = Self {
29660 payload_type: MavTunnelPayloadType::DEFAULT,
29661 target_system: 0_u8,
29662 target_component: 0_u8,
29663 payload_length: 0_u8,
29664 payload: [0_u8; 128usize],
29665 };
29666 #[cfg(feature = "arbitrary")]
29667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29668 use arbitrary::{Arbitrary, Unstructured};
29669 let mut buf = [0u8; 1024];
29670 rng.fill_bytes(&mut buf);
29671 let mut unstructured = Unstructured::new(&buf);
29672 Self::arbitrary(&mut unstructured).unwrap_or_default()
29673 }
29674}
29675impl Default for TUNNEL_DATA {
29676 fn default() -> Self {
29677 Self::DEFAULT.clone()
29678 }
29679}
29680impl MessageData for TUNNEL_DATA {
29681 type Message = MavMessage;
29682 const ID: u32 = 385u32;
29683 const NAME: &'static str = "TUNNEL";
29684 const EXTRA_CRC: u8 = 147u8;
29685 const ENCODED_LEN: usize = 133usize;
29686 fn deser(
29687 _version: MavlinkVersion,
29688 __input: &[u8],
29689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29690 let avail_len = __input.len();
29691 let mut payload_buf = [0; Self::ENCODED_LEN];
29692 let mut buf = if avail_len < Self::ENCODED_LEN {
29693 payload_buf[0..avail_len].copy_from_slice(__input);
29694 Bytes::new(&payload_buf)
29695 } else {
29696 Bytes::new(__input)
29697 };
29698 let mut __struct = Self::default();
29699 let tmp = buf.get_u16_le();
29700 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29701 ::mavlink_core::error::ParserError::InvalidEnum {
29702 enum_type: "MavTunnelPayloadType",
29703 value: tmp as u32,
29704 },
29705 )?;
29706 __struct.target_system = buf.get_u8();
29707 __struct.target_component = buf.get_u8();
29708 __struct.payload_length = buf.get_u8();
29709 for v in &mut __struct.payload {
29710 let val = buf.get_u8();
29711 *v = val;
29712 }
29713 Ok(__struct)
29714 }
29715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29716 let mut __tmp = BytesMut::new(bytes);
29717 #[allow(clippy::absurd_extreme_comparisons)]
29718 #[allow(unused_comparisons)]
29719 if __tmp.remaining() < Self::ENCODED_LEN {
29720 panic!(
29721 "buffer is too small (need {} bytes, but got {})",
29722 Self::ENCODED_LEN,
29723 __tmp.remaining(),
29724 )
29725 }
29726 __tmp.put_u16_le(self.payload_type as u16);
29727 __tmp.put_u8(self.target_system);
29728 __tmp.put_u8(self.target_component);
29729 __tmp.put_u8(self.payload_length);
29730 for val in &self.payload {
29731 __tmp.put_u8(*val);
29732 }
29733 if matches!(version, MavlinkVersion::V2) {
29734 let len = __tmp.len();
29735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29736 } else {
29737 __tmp.len()
29738 }
29739 }
29740}
29741#[doc = "id: 311"]
29742#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29743#[derive(Debug, Clone, PartialEq)]
29744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29746pub struct UAVCAN_NODE_INFO_DATA {
29747 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29748 pub time_usec: u64,
29749 #[doc = "Time since the start-up of the node."]
29750 pub uptime_sec: u32,
29751 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29752 pub sw_vcs_commit: u32,
29753 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29755 pub name: [u8; 80],
29756 #[doc = "Hardware major version number."]
29757 pub hw_version_major: u8,
29758 #[doc = "Hardware minor version number."]
29759 pub hw_version_minor: u8,
29760 #[doc = "Hardware unique 128-bit ID."]
29761 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29762 pub hw_unique_id: [u8; 16],
29763 #[doc = "Software major version number."]
29764 pub sw_version_major: u8,
29765 #[doc = "Software minor version number."]
29766 pub sw_version_minor: u8,
29767}
29768impl UAVCAN_NODE_INFO_DATA {
29769 pub const ENCODED_LEN: usize = 116usize;
29770 pub const DEFAULT: Self = Self {
29771 time_usec: 0_u64,
29772 uptime_sec: 0_u32,
29773 sw_vcs_commit: 0_u32,
29774 name: [0_u8; 80usize],
29775 hw_version_major: 0_u8,
29776 hw_version_minor: 0_u8,
29777 hw_unique_id: [0_u8; 16usize],
29778 sw_version_major: 0_u8,
29779 sw_version_minor: 0_u8,
29780 };
29781 #[cfg(feature = "arbitrary")]
29782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29783 use arbitrary::{Arbitrary, Unstructured};
29784 let mut buf = [0u8; 1024];
29785 rng.fill_bytes(&mut buf);
29786 let mut unstructured = Unstructured::new(&buf);
29787 Self::arbitrary(&mut unstructured).unwrap_or_default()
29788 }
29789}
29790impl Default for UAVCAN_NODE_INFO_DATA {
29791 fn default() -> Self {
29792 Self::DEFAULT.clone()
29793 }
29794}
29795impl MessageData for UAVCAN_NODE_INFO_DATA {
29796 type Message = MavMessage;
29797 const ID: u32 = 311u32;
29798 const NAME: &'static str = "UAVCAN_NODE_INFO";
29799 const EXTRA_CRC: u8 = 95u8;
29800 const ENCODED_LEN: usize = 116usize;
29801 fn deser(
29802 _version: MavlinkVersion,
29803 __input: &[u8],
29804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29805 let avail_len = __input.len();
29806 let mut payload_buf = [0; Self::ENCODED_LEN];
29807 let mut buf = if avail_len < Self::ENCODED_LEN {
29808 payload_buf[0..avail_len].copy_from_slice(__input);
29809 Bytes::new(&payload_buf)
29810 } else {
29811 Bytes::new(__input)
29812 };
29813 let mut __struct = Self::default();
29814 __struct.time_usec = buf.get_u64_le();
29815 __struct.uptime_sec = buf.get_u32_le();
29816 __struct.sw_vcs_commit = buf.get_u32_le();
29817 for v in &mut __struct.name {
29818 let val = buf.get_u8();
29819 *v = val;
29820 }
29821 __struct.hw_version_major = buf.get_u8();
29822 __struct.hw_version_minor = buf.get_u8();
29823 for v in &mut __struct.hw_unique_id {
29824 let val = buf.get_u8();
29825 *v = val;
29826 }
29827 __struct.sw_version_major = buf.get_u8();
29828 __struct.sw_version_minor = buf.get_u8();
29829 Ok(__struct)
29830 }
29831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29832 let mut __tmp = BytesMut::new(bytes);
29833 #[allow(clippy::absurd_extreme_comparisons)]
29834 #[allow(unused_comparisons)]
29835 if __tmp.remaining() < Self::ENCODED_LEN {
29836 panic!(
29837 "buffer is too small (need {} bytes, but got {})",
29838 Self::ENCODED_LEN,
29839 __tmp.remaining(),
29840 )
29841 }
29842 __tmp.put_u64_le(self.time_usec);
29843 __tmp.put_u32_le(self.uptime_sec);
29844 __tmp.put_u32_le(self.sw_vcs_commit);
29845 for val in &self.name {
29846 __tmp.put_u8(*val);
29847 }
29848 __tmp.put_u8(self.hw_version_major);
29849 __tmp.put_u8(self.hw_version_minor);
29850 for val in &self.hw_unique_id {
29851 __tmp.put_u8(*val);
29852 }
29853 __tmp.put_u8(self.sw_version_major);
29854 __tmp.put_u8(self.sw_version_minor);
29855 if matches!(version, MavlinkVersion::V2) {
29856 let len = __tmp.len();
29857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29858 } else {
29859 __tmp.len()
29860 }
29861 }
29862}
29863#[doc = "id: 310"]
29864#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29865#[derive(Debug, Clone, PartialEq)]
29866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29868pub struct UAVCAN_NODE_STATUS_DATA {
29869 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29870 pub time_usec: u64,
29871 #[doc = "Time since the start-up of the node."]
29872 pub uptime_sec: u32,
29873 #[doc = "Vendor-specific status information."]
29874 pub vendor_specific_status_code: u16,
29875 #[doc = "Generalized node health status."]
29876 pub health: UavcanNodeHealth,
29877 #[doc = "Generalized operating mode."]
29878 pub mode: UavcanNodeMode,
29879 #[doc = "Not used currently."]
29880 pub sub_mode: u8,
29881}
29882impl UAVCAN_NODE_STATUS_DATA {
29883 pub const ENCODED_LEN: usize = 17usize;
29884 pub const DEFAULT: Self = Self {
29885 time_usec: 0_u64,
29886 uptime_sec: 0_u32,
29887 vendor_specific_status_code: 0_u16,
29888 health: UavcanNodeHealth::DEFAULT,
29889 mode: UavcanNodeMode::DEFAULT,
29890 sub_mode: 0_u8,
29891 };
29892 #[cfg(feature = "arbitrary")]
29893 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29894 use arbitrary::{Arbitrary, Unstructured};
29895 let mut buf = [0u8; 1024];
29896 rng.fill_bytes(&mut buf);
29897 let mut unstructured = Unstructured::new(&buf);
29898 Self::arbitrary(&mut unstructured).unwrap_or_default()
29899 }
29900}
29901impl Default for UAVCAN_NODE_STATUS_DATA {
29902 fn default() -> Self {
29903 Self::DEFAULT.clone()
29904 }
29905}
29906impl MessageData for UAVCAN_NODE_STATUS_DATA {
29907 type Message = MavMessage;
29908 const ID: u32 = 310u32;
29909 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29910 const EXTRA_CRC: u8 = 28u8;
29911 const ENCODED_LEN: usize = 17usize;
29912 fn deser(
29913 _version: MavlinkVersion,
29914 __input: &[u8],
29915 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29916 let avail_len = __input.len();
29917 let mut payload_buf = [0; Self::ENCODED_LEN];
29918 let mut buf = if avail_len < Self::ENCODED_LEN {
29919 payload_buf[0..avail_len].copy_from_slice(__input);
29920 Bytes::new(&payload_buf)
29921 } else {
29922 Bytes::new(__input)
29923 };
29924 let mut __struct = Self::default();
29925 __struct.time_usec = buf.get_u64_le();
29926 __struct.uptime_sec = buf.get_u32_le();
29927 __struct.vendor_specific_status_code = buf.get_u16_le();
29928 let tmp = buf.get_u8();
29929 __struct.health =
29930 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29931 enum_type: "UavcanNodeHealth",
29932 value: tmp as u32,
29933 })?;
29934 let tmp = buf.get_u8();
29935 __struct.mode =
29936 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29937 enum_type: "UavcanNodeMode",
29938 value: tmp as u32,
29939 })?;
29940 __struct.sub_mode = buf.get_u8();
29941 Ok(__struct)
29942 }
29943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29944 let mut __tmp = BytesMut::new(bytes);
29945 #[allow(clippy::absurd_extreme_comparisons)]
29946 #[allow(unused_comparisons)]
29947 if __tmp.remaining() < Self::ENCODED_LEN {
29948 panic!(
29949 "buffer is too small (need {} bytes, but got {})",
29950 Self::ENCODED_LEN,
29951 __tmp.remaining(),
29952 )
29953 }
29954 __tmp.put_u64_le(self.time_usec);
29955 __tmp.put_u32_le(self.uptime_sec);
29956 __tmp.put_u16_le(self.vendor_specific_status_code);
29957 __tmp.put_u8(self.health as u8);
29958 __tmp.put_u8(self.mode as u8);
29959 __tmp.put_u8(self.sub_mode);
29960 if matches!(version, MavlinkVersion::V2) {
29961 let len = __tmp.len();
29962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29963 } else {
29964 __tmp.len()
29965 }
29966 }
29967}
29968#[doc = "id: 340"]
29969#[doc = "The global position resulting from GPS and sensor fusion."]
29970#[derive(Debug, Clone, PartialEq)]
29971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29973pub struct UTM_GLOBAL_POSITION_DATA {
29974 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
29975 pub time: u64,
29976 #[doc = "Latitude (WGS84)"]
29977 pub lat: i32,
29978 #[doc = "Longitude (WGS84)"]
29979 pub lon: i32,
29980 #[doc = "Altitude (WGS84)"]
29981 pub alt: i32,
29982 #[doc = "Altitude above ground"]
29983 pub relative_alt: i32,
29984 #[doc = "Next waypoint, latitude (WGS84)"]
29985 pub next_lat: i32,
29986 #[doc = "Next waypoint, longitude (WGS84)"]
29987 pub next_lon: i32,
29988 #[doc = "Next waypoint, altitude (WGS84)"]
29989 pub next_alt: i32,
29990 #[doc = "Ground X speed (latitude, positive north)"]
29991 pub vx: i16,
29992 #[doc = "Ground Y speed (longitude, positive east)"]
29993 pub vy: i16,
29994 #[doc = "Ground Z speed (altitude, positive down)"]
29995 pub vz: i16,
29996 #[doc = "Horizontal position uncertainty (standard deviation)"]
29997 pub h_acc: u16,
29998 #[doc = "Altitude uncertainty (standard deviation)"]
29999 pub v_acc: u16,
30000 #[doc = "Speed uncertainty (standard deviation)"]
30001 pub vel_acc: u16,
30002 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30003 pub update_rate: u16,
30004 #[doc = "Unique UAS ID."]
30005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30006 pub uas_id: [u8; 18],
30007 #[doc = "Flight state"]
30008 pub flight_state: UtmFlightState,
30009 #[doc = "Bitwise OR combination of the data available flags."]
30010 pub flags: UtmDataAvailFlags,
30011}
30012impl UTM_GLOBAL_POSITION_DATA {
30013 pub const ENCODED_LEN: usize = 70usize;
30014 pub const DEFAULT: Self = Self {
30015 time: 0_u64,
30016 lat: 0_i32,
30017 lon: 0_i32,
30018 alt: 0_i32,
30019 relative_alt: 0_i32,
30020 next_lat: 0_i32,
30021 next_lon: 0_i32,
30022 next_alt: 0_i32,
30023 vx: 0_i16,
30024 vy: 0_i16,
30025 vz: 0_i16,
30026 h_acc: 0_u16,
30027 v_acc: 0_u16,
30028 vel_acc: 0_u16,
30029 update_rate: 0_u16,
30030 uas_id: [0_u8; 18usize],
30031 flight_state: UtmFlightState::DEFAULT,
30032 flags: UtmDataAvailFlags::DEFAULT,
30033 };
30034 #[cfg(feature = "arbitrary")]
30035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30036 use arbitrary::{Arbitrary, Unstructured};
30037 let mut buf = [0u8; 1024];
30038 rng.fill_bytes(&mut buf);
30039 let mut unstructured = Unstructured::new(&buf);
30040 Self::arbitrary(&mut unstructured).unwrap_or_default()
30041 }
30042}
30043impl Default for UTM_GLOBAL_POSITION_DATA {
30044 fn default() -> Self {
30045 Self::DEFAULT.clone()
30046 }
30047}
30048impl MessageData for UTM_GLOBAL_POSITION_DATA {
30049 type Message = MavMessage;
30050 const ID: u32 = 340u32;
30051 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30052 const EXTRA_CRC: u8 = 99u8;
30053 const ENCODED_LEN: usize = 70usize;
30054 fn deser(
30055 _version: MavlinkVersion,
30056 __input: &[u8],
30057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30058 let avail_len = __input.len();
30059 let mut payload_buf = [0; Self::ENCODED_LEN];
30060 let mut buf = if avail_len < Self::ENCODED_LEN {
30061 payload_buf[0..avail_len].copy_from_slice(__input);
30062 Bytes::new(&payload_buf)
30063 } else {
30064 Bytes::new(__input)
30065 };
30066 let mut __struct = Self::default();
30067 __struct.time = buf.get_u64_le();
30068 __struct.lat = buf.get_i32_le();
30069 __struct.lon = buf.get_i32_le();
30070 __struct.alt = buf.get_i32_le();
30071 __struct.relative_alt = buf.get_i32_le();
30072 __struct.next_lat = buf.get_i32_le();
30073 __struct.next_lon = buf.get_i32_le();
30074 __struct.next_alt = buf.get_i32_le();
30075 __struct.vx = buf.get_i16_le();
30076 __struct.vy = buf.get_i16_le();
30077 __struct.vz = buf.get_i16_le();
30078 __struct.h_acc = buf.get_u16_le();
30079 __struct.v_acc = buf.get_u16_le();
30080 __struct.vel_acc = buf.get_u16_le();
30081 __struct.update_rate = buf.get_u16_le();
30082 for v in &mut __struct.uas_id {
30083 let val = buf.get_u8();
30084 *v = val;
30085 }
30086 let tmp = buf.get_u8();
30087 __struct.flight_state =
30088 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30089 enum_type: "UtmFlightState",
30090 value: tmp as u32,
30091 })?;
30092 let tmp = buf.get_u8();
30093 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
30094 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30095 flag_type: "UtmDataAvailFlags",
30096 value: tmp as u32,
30097 })?;
30098 Ok(__struct)
30099 }
30100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30101 let mut __tmp = BytesMut::new(bytes);
30102 #[allow(clippy::absurd_extreme_comparisons)]
30103 #[allow(unused_comparisons)]
30104 if __tmp.remaining() < Self::ENCODED_LEN {
30105 panic!(
30106 "buffer is too small (need {} bytes, but got {})",
30107 Self::ENCODED_LEN,
30108 __tmp.remaining(),
30109 )
30110 }
30111 __tmp.put_u64_le(self.time);
30112 __tmp.put_i32_le(self.lat);
30113 __tmp.put_i32_le(self.lon);
30114 __tmp.put_i32_le(self.alt);
30115 __tmp.put_i32_le(self.relative_alt);
30116 __tmp.put_i32_le(self.next_lat);
30117 __tmp.put_i32_le(self.next_lon);
30118 __tmp.put_i32_le(self.next_alt);
30119 __tmp.put_i16_le(self.vx);
30120 __tmp.put_i16_le(self.vy);
30121 __tmp.put_i16_le(self.vz);
30122 __tmp.put_u16_le(self.h_acc);
30123 __tmp.put_u16_le(self.v_acc);
30124 __tmp.put_u16_le(self.vel_acc);
30125 __tmp.put_u16_le(self.update_rate);
30126 for val in &self.uas_id {
30127 __tmp.put_u8(*val);
30128 }
30129 __tmp.put_u8(self.flight_state as u8);
30130 __tmp.put_u8(self.flags.bits());
30131 if matches!(version, MavlinkVersion::V2) {
30132 let len = __tmp.len();
30133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30134 } else {
30135 __tmp.len()
30136 }
30137 }
30138}
30139#[doc = "id: 248"]
30140#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30141#[derive(Debug, Clone, PartialEq)]
30142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30144pub struct V2_EXTENSION_DATA {
30145 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30146 pub message_type: u16,
30147 #[doc = "Network ID (0 for broadcast)"]
30148 pub target_network: u8,
30149 #[doc = "System ID (0 for broadcast)"]
30150 pub target_system: u8,
30151 #[doc = "Component ID (0 for broadcast)"]
30152 pub target_component: u8,
30153 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30155 pub payload: [u8; 249],
30156}
30157impl V2_EXTENSION_DATA {
30158 pub const ENCODED_LEN: usize = 254usize;
30159 pub const DEFAULT: Self = Self {
30160 message_type: 0_u16,
30161 target_network: 0_u8,
30162 target_system: 0_u8,
30163 target_component: 0_u8,
30164 payload: [0_u8; 249usize],
30165 };
30166 #[cfg(feature = "arbitrary")]
30167 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30168 use arbitrary::{Arbitrary, Unstructured};
30169 let mut buf = [0u8; 1024];
30170 rng.fill_bytes(&mut buf);
30171 let mut unstructured = Unstructured::new(&buf);
30172 Self::arbitrary(&mut unstructured).unwrap_or_default()
30173 }
30174}
30175impl Default for V2_EXTENSION_DATA {
30176 fn default() -> Self {
30177 Self::DEFAULT.clone()
30178 }
30179}
30180impl MessageData for V2_EXTENSION_DATA {
30181 type Message = MavMessage;
30182 const ID: u32 = 248u32;
30183 const NAME: &'static str = "V2_EXTENSION";
30184 const EXTRA_CRC: u8 = 8u8;
30185 const ENCODED_LEN: usize = 254usize;
30186 fn deser(
30187 _version: MavlinkVersion,
30188 __input: &[u8],
30189 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30190 let avail_len = __input.len();
30191 let mut payload_buf = [0; Self::ENCODED_LEN];
30192 let mut buf = if avail_len < Self::ENCODED_LEN {
30193 payload_buf[0..avail_len].copy_from_slice(__input);
30194 Bytes::new(&payload_buf)
30195 } else {
30196 Bytes::new(__input)
30197 };
30198 let mut __struct = Self::default();
30199 __struct.message_type = buf.get_u16_le();
30200 __struct.target_network = buf.get_u8();
30201 __struct.target_system = buf.get_u8();
30202 __struct.target_component = buf.get_u8();
30203 for v in &mut __struct.payload {
30204 let val = buf.get_u8();
30205 *v = val;
30206 }
30207 Ok(__struct)
30208 }
30209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30210 let mut __tmp = BytesMut::new(bytes);
30211 #[allow(clippy::absurd_extreme_comparisons)]
30212 #[allow(unused_comparisons)]
30213 if __tmp.remaining() < Self::ENCODED_LEN {
30214 panic!(
30215 "buffer is too small (need {} bytes, but got {})",
30216 Self::ENCODED_LEN,
30217 __tmp.remaining(),
30218 )
30219 }
30220 __tmp.put_u16_le(self.message_type);
30221 __tmp.put_u8(self.target_network);
30222 __tmp.put_u8(self.target_system);
30223 __tmp.put_u8(self.target_component);
30224 for val in &self.payload {
30225 __tmp.put_u8(*val);
30226 }
30227 if matches!(version, MavlinkVersion::V2) {
30228 let len = __tmp.len();
30229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30230 } else {
30231 __tmp.len()
30232 }
30233 }
30234}
30235#[doc = "id: 74"]
30236#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30237#[derive(Debug, Clone, PartialEq)]
30238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30240pub struct VFR_HUD_DATA {
30241 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30242 pub airspeed: f32,
30243 #[doc = "Current ground speed."]
30244 pub groundspeed: f32,
30245 #[doc = "Current altitude (MSL)."]
30246 pub alt: f32,
30247 #[doc = "Current climb rate."]
30248 pub climb: f32,
30249 #[doc = "Current heading in compass units (0-360, 0=north)."]
30250 pub heading: i16,
30251 #[doc = "Current throttle setting (0 to 100)."]
30252 pub throttle: u16,
30253}
30254impl VFR_HUD_DATA {
30255 pub const ENCODED_LEN: usize = 20usize;
30256 pub const DEFAULT: Self = Self {
30257 airspeed: 0.0_f32,
30258 groundspeed: 0.0_f32,
30259 alt: 0.0_f32,
30260 climb: 0.0_f32,
30261 heading: 0_i16,
30262 throttle: 0_u16,
30263 };
30264 #[cfg(feature = "arbitrary")]
30265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30266 use arbitrary::{Arbitrary, Unstructured};
30267 let mut buf = [0u8; 1024];
30268 rng.fill_bytes(&mut buf);
30269 let mut unstructured = Unstructured::new(&buf);
30270 Self::arbitrary(&mut unstructured).unwrap_or_default()
30271 }
30272}
30273impl Default for VFR_HUD_DATA {
30274 fn default() -> Self {
30275 Self::DEFAULT.clone()
30276 }
30277}
30278impl MessageData for VFR_HUD_DATA {
30279 type Message = MavMessage;
30280 const ID: u32 = 74u32;
30281 const NAME: &'static str = "VFR_HUD";
30282 const EXTRA_CRC: u8 = 20u8;
30283 const ENCODED_LEN: usize = 20usize;
30284 fn deser(
30285 _version: MavlinkVersion,
30286 __input: &[u8],
30287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30288 let avail_len = __input.len();
30289 let mut payload_buf = [0; Self::ENCODED_LEN];
30290 let mut buf = if avail_len < Self::ENCODED_LEN {
30291 payload_buf[0..avail_len].copy_from_slice(__input);
30292 Bytes::new(&payload_buf)
30293 } else {
30294 Bytes::new(__input)
30295 };
30296 let mut __struct = Self::default();
30297 __struct.airspeed = buf.get_f32_le();
30298 __struct.groundspeed = buf.get_f32_le();
30299 __struct.alt = buf.get_f32_le();
30300 __struct.climb = buf.get_f32_le();
30301 __struct.heading = buf.get_i16_le();
30302 __struct.throttle = buf.get_u16_le();
30303 Ok(__struct)
30304 }
30305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30306 let mut __tmp = BytesMut::new(bytes);
30307 #[allow(clippy::absurd_extreme_comparisons)]
30308 #[allow(unused_comparisons)]
30309 if __tmp.remaining() < Self::ENCODED_LEN {
30310 panic!(
30311 "buffer is too small (need {} bytes, but got {})",
30312 Self::ENCODED_LEN,
30313 __tmp.remaining(),
30314 )
30315 }
30316 __tmp.put_f32_le(self.airspeed);
30317 __tmp.put_f32_le(self.groundspeed);
30318 __tmp.put_f32_le(self.alt);
30319 __tmp.put_f32_le(self.climb);
30320 __tmp.put_i16_le(self.heading);
30321 __tmp.put_u16_le(self.throttle);
30322 if matches!(version, MavlinkVersion::V2) {
30323 let len = __tmp.len();
30324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30325 } else {
30326 __tmp.len()
30327 }
30328 }
30329}
30330#[doc = "id: 241"]
30331#[doc = "Vibration levels and accelerometer clipping."]
30332#[derive(Debug, Clone, PartialEq)]
30333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30335pub struct VIBRATION_DATA {
30336 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30337 pub time_usec: u64,
30338 #[doc = "Vibration levels on X-axis"]
30339 pub vibration_x: f32,
30340 #[doc = "Vibration levels on Y-axis"]
30341 pub vibration_y: f32,
30342 #[doc = "Vibration levels on Z-axis"]
30343 pub vibration_z: f32,
30344 #[doc = "first accelerometer clipping count"]
30345 pub clipping_0: u32,
30346 #[doc = "second accelerometer clipping count"]
30347 pub clipping_1: u32,
30348 #[doc = "third accelerometer clipping count"]
30349 pub clipping_2: u32,
30350}
30351impl VIBRATION_DATA {
30352 pub const ENCODED_LEN: usize = 32usize;
30353 pub const DEFAULT: Self = Self {
30354 time_usec: 0_u64,
30355 vibration_x: 0.0_f32,
30356 vibration_y: 0.0_f32,
30357 vibration_z: 0.0_f32,
30358 clipping_0: 0_u32,
30359 clipping_1: 0_u32,
30360 clipping_2: 0_u32,
30361 };
30362 #[cfg(feature = "arbitrary")]
30363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30364 use arbitrary::{Arbitrary, Unstructured};
30365 let mut buf = [0u8; 1024];
30366 rng.fill_bytes(&mut buf);
30367 let mut unstructured = Unstructured::new(&buf);
30368 Self::arbitrary(&mut unstructured).unwrap_or_default()
30369 }
30370}
30371impl Default for VIBRATION_DATA {
30372 fn default() -> Self {
30373 Self::DEFAULT.clone()
30374 }
30375}
30376impl MessageData for VIBRATION_DATA {
30377 type Message = MavMessage;
30378 const ID: u32 = 241u32;
30379 const NAME: &'static str = "VIBRATION";
30380 const EXTRA_CRC: u8 = 90u8;
30381 const ENCODED_LEN: usize = 32usize;
30382 fn deser(
30383 _version: MavlinkVersion,
30384 __input: &[u8],
30385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30386 let avail_len = __input.len();
30387 let mut payload_buf = [0; Self::ENCODED_LEN];
30388 let mut buf = if avail_len < Self::ENCODED_LEN {
30389 payload_buf[0..avail_len].copy_from_slice(__input);
30390 Bytes::new(&payload_buf)
30391 } else {
30392 Bytes::new(__input)
30393 };
30394 let mut __struct = Self::default();
30395 __struct.time_usec = buf.get_u64_le();
30396 __struct.vibration_x = buf.get_f32_le();
30397 __struct.vibration_y = buf.get_f32_le();
30398 __struct.vibration_z = buf.get_f32_le();
30399 __struct.clipping_0 = buf.get_u32_le();
30400 __struct.clipping_1 = buf.get_u32_le();
30401 __struct.clipping_2 = buf.get_u32_le();
30402 Ok(__struct)
30403 }
30404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30405 let mut __tmp = BytesMut::new(bytes);
30406 #[allow(clippy::absurd_extreme_comparisons)]
30407 #[allow(unused_comparisons)]
30408 if __tmp.remaining() < Self::ENCODED_LEN {
30409 panic!(
30410 "buffer is too small (need {} bytes, but got {})",
30411 Self::ENCODED_LEN,
30412 __tmp.remaining(),
30413 )
30414 }
30415 __tmp.put_u64_le(self.time_usec);
30416 __tmp.put_f32_le(self.vibration_x);
30417 __tmp.put_f32_le(self.vibration_y);
30418 __tmp.put_f32_le(self.vibration_z);
30419 __tmp.put_u32_le(self.clipping_0);
30420 __tmp.put_u32_le(self.clipping_1);
30421 __tmp.put_u32_le(self.clipping_2);
30422 if matches!(version, MavlinkVersion::V2) {
30423 let len = __tmp.len();
30424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30425 } else {
30426 __tmp.len()
30427 }
30428 }
30429}
30430#[doc = "id: 104"]
30431#[doc = "Global position estimate from a Vicon motion system source."]
30432#[derive(Debug, Clone, PartialEq)]
30433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30435pub struct VICON_POSITION_ESTIMATE_DATA {
30436 #[doc = "Timestamp (UNIX time or time since system boot)"]
30437 pub usec: u64,
30438 #[doc = "Global X position"]
30439 pub x: f32,
30440 #[doc = "Global Y position"]
30441 pub y: f32,
30442 #[doc = "Global Z position"]
30443 pub z: f32,
30444 #[doc = "Roll angle"]
30445 pub roll: f32,
30446 #[doc = "Pitch angle"]
30447 pub pitch: f32,
30448 #[doc = "Yaw angle"]
30449 pub yaw: f32,
30450 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30451 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30452 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30453 pub covariance: [f32; 21],
30454}
30455impl VICON_POSITION_ESTIMATE_DATA {
30456 pub const ENCODED_LEN: usize = 116usize;
30457 pub const DEFAULT: Self = Self {
30458 usec: 0_u64,
30459 x: 0.0_f32,
30460 y: 0.0_f32,
30461 z: 0.0_f32,
30462 roll: 0.0_f32,
30463 pitch: 0.0_f32,
30464 yaw: 0.0_f32,
30465 covariance: [0.0_f32; 21usize],
30466 };
30467 #[cfg(feature = "arbitrary")]
30468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30469 use arbitrary::{Arbitrary, Unstructured};
30470 let mut buf = [0u8; 1024];
30471 rng.fill_bytes(&mut buf);
30472 let mut unstructured = Unstructured::new(&buf);
30473 Self::arbitrary(&mut unstructured).unwrap_or_default()
30474 }
30475}
30476impl Default for VICON_POSITION_ESTIMATE_DATA {
30477 fn default() -> Self {
30478 Self::DEFAULT.clone()
30479 }
30480}
30481impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30482 type Message = MavMessage;
30483 const ID: u32 = 104u32;
30484 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30485 const EXTRA_CRC: u8 = 56u8;
30486 const ENCODED_LEN: usize = 116usize;
30487 fn deser(
30488 _version: MavlinkVersion,
30489 __input: &[u8],
30490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30491 let avail_len = __input.len();
30492 let mut payload_buf = [0; Self::ENCODED_LEN];
30493 let mut buf = if avail_len < Self::ENCODED_LEN {
30494 payload_buf[0..avail_len].copy_from_slice(__input);
30495 Bytes::new(&payload_buf)
30496 } else {
30497 Bytes::new(__input)
30498 };
30499 let mut __struct = Self::default();
30500 __struct.usec = buf.get_u64_le();
30501 __struct.x = buf.get_f32_le();
30502 __struct.y = buf.get_f32_le();
30503 __struct.z = buf.get_f32_le();
30504 __struct.roll = buf.get_f32_le();
30505 __struct.pitch = buf.get_f32_le();
30506 __struct.yaw = buf.get_f32_le();
30507 for v in &mut __struct.covariance {
30508 let val = buf.get_f32_le();
30509 *v = val;
30510 }
30511 Ok(__struct)
30512 }
30513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30514 let mut __tmp = BytesMut::new(bytes);
30515 #[allow(clippy::absurd_extreme_comparisons)]
30516 #[allow(unused_comparisons)]
30517 if __tmp.remaining() < Self::ENCODED_LEN {
30518 panic!(
30519 "buffer is too small (need {} bytes, but got {})",
30520 Self::ENCODED_LEN,
30521 __tmp.remaining(),
30522 )
30523 }
30524 __tmp.put_u64_le(self.usec);
30525 __tmp.put_f32_le(self.x);
30526 __tmp.put_f32_le(self.y);
30527 __tmp.put_f32_le(self.z);
30528 __tmp.put_f32_le(self.roll);
30529 __tmp.put_f32_le(self.pitch);
30530 __tmp.put_f32_le(self.yaw);
30531 for val in &self.covariance {
30532 __tmp.put_f32_le(*val);
30533 }
30534 if matches!(version, MavlinkVersion::V2) {
30535 let len = __tmp.len();
30536 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30537 } else {
30538 __tmp.len()
30539 }
30540 }
30541}
30542#[doc = "id: 269"]
30543#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30544#[derive(Debug, Clone, PartialEq)]
30545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30547pub struct VIDEO_STREAM_INFORMATION_DATA {
30548 #[doc = "Frame rate."]
30549 pub framerate: f32,
30550 #[doc = "Bit rate."]
30551 pub bitrate: u32,
30552 #[doc = "Bitmap of stream status flags."]
30553 pub flags: VideoStreamStatusFlags,
30554 #[doc = "Horizontal resolution."]
30555 pub resolution_h: u16,
30556 #[doc = "Vertical resolution."]
30557 pub resolution_v: u16,
30558 #[doc = "Video image rotation clockwise."]
30559 pub rotation: u16,
30560 #[doc = "Horizontal Field of view."]
30561 pub hfov: u16,
30562 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30563 pub stream_id: u8,
30564 #[doc = "Number of streams available."]
30565 pub count: u8,
30566 #[doc = "Type of stream."]
30567 pub mavtype: VideoStreamType,
30568 #[doc = "Stream name."]
30569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30570 pub name: [u8; 32],
30571 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30572 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30573 pub uri: [u8; 160],
30574 #[doc = "Encoding of stream."]
30575 #[cfg_attr(feature = "serde", serde(default))]
30576 pub encoding: VideoStreamEncoding,
30577 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30578 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30579 pub camera_device_id: u8,
30580}
30581impl VIDEO_STREAM_INFORMATION_DATA {
30582 pub const ENCODED_LEN: usize = 215usize;
30583 pub const DEFAULT: Self = Self {
30584 framerate: 0.0_f32,
30585 bitrate: 0_u32,
30586 flags: VideoStreamStatusFlags::DEFAULT,
30587 resolution_h: 0_u16,
30588 resolution_v: 0_u16,
30589 rotation: 0_u16,
30590 hfov: 0_u16,
30591 stream_id: 0_u8,
30592 count: 0_u8,
30593 mavtype: VideoStreamType::DEFAULT,
30594 name: [0_u8; 32usize],
30595 uri: [0_u8; 160usize],
30596 encoding: VideoStreamEncoding::DEFAULT,
30597 camera_device_id: 0_u8,
30598 };
30599 #[cfg(feature = "arbitrary")]
30600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30601 use arbitrary::{Arbitrary, Unstructured};
30602 let mut buf = [0u8; 1024];
30603 rng.fill_bytes(&mut buf);
30604 let mut unstructured = Unstructured::new(&buf);
30605 Self::arbitrary(&mut unstructured).unwrap_or_default()
30606 }
30607}
30608impl Default for VIDEO_STREAM_INFORMATION_DATA {
30609 fn default() -> Self {
30610 Self::DEFAULT.clone()
30611 }
30612}
30613impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30614 type Message = MavMessage;
30615 const ID: u32 = 269u32;
30616 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30617 const EXTRA_CRC: u8 = 109u8;
30618 const ENCODED_LEN: usize = 215usize;
30619 fn deser(
30620 _version: MavlinkVersion,
30621 __input: &[u8],
30622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30623 let avail_len = __input.len();
30624 let mut payload_buf = [0; Self::ENCODED_LEN];
30625 let mut buf = if avail_len < Self::ENCODED_LEN {
30626 payload_buf[0..avail_len].copy_from_slice(__input);
30627 Bytes::new(&payload_buf)
30628 } else {
30629 Bytes::new(__input)
30630 };
30631 let mut __struct = Self::default();
30632 __struct.framerate = buf.get_f32_le();
30633 __struct.bitrate = buf.get_u32_le();
30634 let tmp = buf.get_u16_le();
30635 __struct.flags = VideoStreamStatusFlags::from_bits(
30636 tmp & VideoStreamStatusFlags::all().bits(),
30637 )
30638 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30639 flag_type: "VideoStreamStatusFlags",
30640 value: tmp as u32,
30641 })?;
30642 __struct.resolution_h = buf.get_u16_le();
30643 __struct.resolution_v = buf.get_u16_le();
30644 __struct.rotation = buf.get_u16_le();
30645 __struct.hfov = buf.get_u16_le();
30646 __struct.stream_id = buf.get_u8();
30647 __struct.count = buf.get_u8();
30648 let tmp = buf.get_u8();
30649 __struct.mavtype =
30650 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30651 enum_type: "VideoStreamType",
30652 value: tmp as u32,
30653 })?;
30654 for v in &mut __struct.name {
30655 let val = buf.get_u8();
30656 *v = val;
30657 }
30658 for v in &mut __struct.uri {
30659 let val = buf.get_u8();
30660 *v = val;
30661 }
30662 let tmp = buf.get_u8();
30663 __struct.encoding =
30664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30665 enum_type: "VideoStreamEncoding",
30666 value: tmp as u32,
30667 })?;
30668 __struct.camera_device_id = buf.get_u8();
30669 Ok(__struct)
30670 }
30671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30672 let mut __tmp = BytesMut::new(bytes);
30673 #[allow(clippy::absurd_extreme_comparisons)]
30674 #[allow(unused_comparisons)]
30675 if __tmp.remaining() < Self::ENCODED_LEN {
30676 panic!(
30677 "buffer is too small (need {} bytes, but got {})",
30678 Self::ENCODED_LEN,
30679 __tmp.remaining(),
30680 )
30681 }
30682 __tmp.put_f32_le(self.framerate);
30683 __tmp.put_u32_le(self.bitrate);
30684 __tmp.put_u16_le(self.flags.bits());
30685 __tmp.put_u16_le(self.resolution_h);
30686 __tmp.put_u16_le(self.resolution_v);
30687 __tmp.put_u16_le(self.rotation);
30688 __tmp.put_u16_le(self.hfov);
30689 __tmp.put_u8(self.stream_id);
30690 __tmp.put_u8(self.count);
30691 __tmp.put_u8(self.mavtype as u8);
30692 for val in &self.name {
30693 __tmp.put_u8(*val);
30694 }
30695 for val in &self.uri {
30696 __tmp.put_u8(*val);
30697 }
30698 __tmp.put_u8(self.encoding as u8);
30699 __tmp.put_u8(self.camera_device_id);
30700 if matches!(version, MavlinkVersion::V2) {
30701 let len = __tmp.len();
30702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30703 } else {
30704 __tmp.len()
30705 }
30706 }
30707}
30708#[doc = "id: 270"]
30709#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30710#[derive(Debug, Clone, PartialEq)]
30711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30713pub struct VIDEO_STREAM_STATUS_DATA {
30714 #[doc = "Frame rate"]
30715 pub framerate: f32,
30716 #[doc = "Bit rate"]
30717 pub bitrate: u32,
30718 #[doc = "Bitmap of stream status flags"]
30719 pub flags: VideoStreamStatusFlags,
30720 #[doc = "Horizontal resolution"]
30721 pub resolution_h: u16,
30722 #[doc = "Vertical resolution"]
30723 pub resolution_v: u16,
30724 #[doc = "Video image rotation clockwise"]
30725 pub rotation: u16,
30726 #[doc = "Horizontal Field of view"]
30727 pub hfov: u16,
30728 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30729 pub stream_id: u8,
30730 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30732 pub camera_device_id: u8,
30733}
30734impl VIDEO_STREAM_STATUS_DATA {
30735 pub const ENCODED_LEN: usize = 20usize;
30736 pub const DEFAULT: Self = Self {
30737 framerate: 0.0_f32,
30738 bitrate: 0_u32,
30739 flags: VideoStreamStatusFlags::DEFAULT,
30740 resolution_h: 0_u16,
30741 resolution_v: 0_u16,
30742 rotation: 0_u16,
30743 hfov: 0_u16,
30744 stream_id: 0_u8,
30745 camera_device_id: 0_u8,
30746 };
30747 #[cfg(feature = "arbitrary")]
30748 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30749 use arbitrary::{Arbitrary, Unstructured};
30750 let mut buf = [0u8; 1024];
30751 rng.fill_bytes(&mut buf);
30752 let mut unstructured = Unstructured::new(&buf);
30753 Self::arbitrary(&mut unstructured).unwrap_or_default()
30754 }
30755}
30756impl Default for VIDEO_STREAM_STATUS_DATA {
30757 fn default() -> Self {
30758 Self::DEFAULT.clone()
30759 }
30760}
30761impl MessageData for VIDEO_STREAM_STATUS_DATA {
30762 type Message = MavMessage;
30763 const ID: u32 = 270u32;
30764 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30765 const EXTRA_CRC: u8 = 59u8;
30766 const ENCODED_LEN: usize = 20usize;
30767 fn deser(
30768 _version: MavlinkVersion,
30769 __input: &[u8],
30770 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30771 let avail_len = __input.len();
30772 let mut payload_buf = [0; Self::ENCODED_LEN];
30773 let mut buf = if avail_len < Self::ENCODED_LEN {
30774 payload_buf[0..avail_len].copy_from_slice(__input);
30775 Bytes::new(&payload_buf)
30776 } else {
30777 Bytes::new(__input)
30778 };
30779 let mut __struct = Self::default();
30780 __struct.framerate = buf.get_f32_le();
30781 __struct.bitrate = buf.get_u32_le();
30782 let tmp = buf.get_u16_le();
30783 __struct.flags = VideoStreamStatusFlags::from_bits(
30784 tmp & VideoStreamStatusFlags::all().bits(),
30785 )
30786 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30787 flag_type: "VideoStreamStatusFlags",
30788 value: tmp as u32,
30789 })?;
30790 __struct.resolution_h = buf.get_u16_le();
30791 __struct.resolution_v = buf.get_u16_le();
30792 __struct.rotation = buf.get_u16_le();
30793 __struct.hfov = buf.get_u16_le();
30794 __struct.stream_id = buf.get_u8();
30795 __struct.camera_device_id = buf.get_u8();
30796 Ok(__struct)
30797 }
30798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30799 let mut __tmp = BytesMut::new(bytes);
30800 #[allow(clippy::absurd_extreme_comparisons)]
30801 #[allow(unused_comparisons)]
30802 if __tmp.remaining() < Self::ENCODED_LEN {
30803 panic!(
30804 "buffer is too small (need {} bytes, but got {})",
30805 Self::ENCODED_LEN,
30806 __tmp.remaining(),
30807 )
30808 }
30809 __tmp.put_f32_le(self.framerate);
30810 __tmp.put_u32_le(self.bitrate);
30811 __tmp.put_u16_le(self.flags.bits());
30812 __tmp.put_u16_le(self.resolution_h);
30813 __tmp.put_u16_le(self.resolution_v);
30814 __tmp.put_u16_le(self.rotation);
30815 __tmp.put_u16_le(self.hfov);
30816 __tmp.put_u8(self.stream_id);
30817 __tmp.put_u8(self.camera_device_id);
30818 if matches!(version, MavlinkVersion::V2) {
30819 let len = __tmp.len();
30820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30821 } else {
30822 __tmp.len()
30823 }
30824 }
30825}
30826#[doc = "id: 102"]
30827#[doc = "Local position/attitude estimate from a vision source."]
30828#[derive(Debug, Clone, PartialEq)]
30829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30831pub struct VISION_POSITION_ESTIMATE_DATA {
30832 #[doc = "Timestamp (UNIX time or time since system boot)"]
30833 pub usec: u64,
30834 #[doc = "Local X position"]
30835 pub x: f32,
30836 #[doc = "Local Y position"]
30837 pub y: f32,
30838 #[doc = "Local Z position"]
30839 pub z: f32,
30840 #[doc = "Roll angle"]
30841 pub roll: f32,
30842 #[doc = "Pitch angle"]
30843 pub pitch: f32,
30844 #[doc = "Yaw angle"]
30845 pub yaw: f32,
30846 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30847 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30849 pub covariance: [f32; 21],
30850 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30851 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30852 pub reset_counter: u8,
30853}
30854impl VISION_POSITION_ESTIMATE_DATA {
30855 pub const ENCODED_LEN: usize = 117usize;
30856 pub const DEFAULT: Self = Self {
30857 usec: 0_u64,
30858 x: 0.0_f32,
30859 y: 0.0_f32,
30860 z: 0.0_f32,
30861 roll: 0.0_f32,
30862 pitch: 0.0_f32,
30863 yaw: 0.0_f32,
30864 covariance: [0.0_f32; 21usize],
30865 reset_counter: 0_u8,
30866 };
30867 #[cfg(feature = "arbitrary")]
30868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30869 use arbitrary::{Arbitrary, Unstructured};
30870 let mut buf = [0u8; 1024];
30871 rng.fill_bytes(&mut buf);
30872 let mut unstructured = Unstructured::new(&buf);
30873 Self::arbitrary(&mut unstructured).unwrap_or_default()
30874 }
30875}
30876impl Default for VISION_POSITION_ESTIMATE_DATA {
30877 fn default() -> Self {
30878 Self::DEFAULT.clone()
30879 }
30880}
30881impl MessageData for VISION_POSITION_ESTIMATE_DATA {
30882 type Message = MavMessage;
30883 const ID: u32 = 102u32;
30884 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
30885 const EXTRA_CRC: u8 = 158u8;
30886 const ENCODED_LEN: usize = 117usize;
30887 fn deser(
30888 _version: MavlinkVersion,
30889 __input: &[u8],
30890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30891 let avail_len = __input.len();
30892 let mut payload_buf = [0; Self::ENCODED_LEN];
30893 let mut buf = if avail_len < Self::ENCODED_LEN {
30894 payload_buf[0..avail_len].copy_from_slice(__input);
30895 Bytes::new(&payload_buf)
30896 } else {
30897 Bytes::new(__input)
30898 };
30899 let mut __struct = Self::default();
30900 __struct.usec = buf.get_u64_le();
30901 __struct.x = buf.get_f32_le();
30902 __struct.y = buf.get_f32_le();
30903 __struct.z = buf.get_f32_le();
30904 __struct.roll = buf.get_f32_le();
30905 __struct.pitch = buf.get_f32_le();
30906 __struct.yaw = buf.get_f32_le();
30907 for v in &mut __struct.covariance {
30908 let val = buf.get_f32_le();
30909 *v = val;
30910 }
30911 __struct.reset_counter = buf.get_u8();
30912 Ok(__struct)
30913 }
30914 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30915 let mut __tmp = BytesMut::new(bytes);
30916 #[allow(clippy::absurd_extreme_comparisons)]
30917 #[allow(unused_comparisons)]
30918 if __tmp.remaining() < Self::ENCODED_LEN {
30919 panic!(
30920 "buffer is too small (need {} bytes, but got {})",
30921 Self::ENCODED_LEN,
30922 __tmp.remaining(),
30923 )
30924 }
30925 __tmp.put_u64_le(self.usec);
30926 __tmp.put_f32_le(self.x);
30927 __tmp.put_f32_le(self.y);
30928 __tmp.put_f32_le(self.z);
30929 __tmp.put_f32_le(self.roll);
30930 __tmp.put_f32_le(self.pitch);
30931 __tmp.put_f32_le(self.yaw);
30932 for val in &self.covariance {
30933 __tmp.put_f32_le(*val);
30934 }
30935 __tmp.put_u8(self.reset_counter);
30936 if matches!(version, MavlinkVersion::V2) {
30937 let len = __tmp.len();
30938 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30939 } else {
30940 __tmp.len()
30941 }
30942 }
30943}
30944#[doc = "id: 103"]
30945#[doc = "Speed estimate from a vision source."]
30946#[derive(Debug, Clone, PartialEq)]
30947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30949pub struct VISION_SPEED_ESTIMATE_DATA {
30950 #[doc = "Timestamp (UNIX time or time since system boot)"]
30951 pub usec: u64,
30952 #[doc = "Global X speed"]
30953 pub x: f32,
30954 #[doc = "Global Y speed"]
30955 pub y: f32,
30956 #[doc = "Global Z speed"]
30957 pub z: f32,
30958 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
30959 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30961 pub covariance: [f32; 9],
30962 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30964 pub reset_counter: u8,
30965}
30966impl VISION_SPEED_ESTIMATE_DATA {
30967 pub const ENCODED_LEN: usize = 57usize;
30968 pub const DEFAULT: Self = Self {
30969 usec: 0_u64,
30970 x: 0.0_f32,
30971 y: 0.0_f32,
30972 z: 0.0_f32,
30973 covariance: [0.0_f32; 9usize],
30974 reset_counter: 0_u8,
30975 };
30976 #[cfg(feature = "arbitrary")]
30977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30978 use arbitrary::{Arbitrary, Unstructured};
30979 let mut buf = [0u8; 1024];
30980 rng.fill_bytes(&mut buf);
30981 let mut unstructured = Unstructured::new(&buf);
30982 Self::arbitrary(&mut unstructured).unwrap_or_default()
30983 }
30984}
30985impl Default for VISION_SPEED_ESTIMATE_DATA {
30986 fn default() -> Self {
30987 Self::DEFAULT.clone()
30988 }
30989}
30990impl MessageData for VISION_SPEED_ESTIMATE_DATA {
30991 type Message = MavMessage;
30992 const ID: u32 = 103u32;
30993 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
30994 const EXTRA_CRC: u8 = 208u8;
30995 const ENCODED_LEN: usize = 57usize;
30996 fn deser(
30997 _version: MavlinkVersion,
30998 __input: &[u8],
30999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31000 let avail_len = __input.len();
31001 let mut payload_buf = [0; Self::ENCODED_LEN];
31002 let mut buf = if avail_len < Self::ENCODED_LEN {
31003 payload_buf[0..avail_len].copy_from_slice(__input);
31004 Bytes::new(&payload_buf)
31005 } else {
31006 Bytes::new(__input)
31007 };
31008 let mut __struct = Self::default();
31009 __struct.usec = buf.get_u64_le();
31010 __struct.x = buf.get_f32_le();
31011 __struct.y = buf.get_f32_le();
31012 __struct.z = buf.get_f32_le();
31013 for v in &mut __struct.covariance {
31014 let val = buf.get_f32_le();
31015 *v = val;
31016 }
31017 __struct.reset_counter = buf.get_u8();
31018 Ok(__struct)
31019 }
31020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31021 let mut __tmp = BytesMut::new(bytes);
31022 #[allow(clippy::absurd_extreme_comparisons)]
31023 #[allow(unused_comparisons)]
31024 if __tmp.remaining() < Self::ENCODED_LEN {
31025 panic!(
31026 "buffer is too small (need {} bytes, but got {})",
31027 Self::ENCODED_LEN,
31028 __tmp.remaining(),
31029 )
31030 }
31031 __tmp.put_u64_le(self.usec);
31032 __tmp.put_f32_le(self.x);
31033 __tmp.put_f32_le(self.y);
31034 __tmp.put_f32_le(self.z);
31035 for val in &self.covariance {
31036 __tmp.put_f32_le(*val);
31037 }
31038 __tmp.put_u8(self.reset_counter);
31039 if matches!(version, MavlinkVersion::V2) {
31040 let len = __tmp.len();
31041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31042 } else {
31043 __tmp.len()
31044 }
31045 }
31046}
31047#[doc = "id: 9000"]
31048#[doc = "Cumulative distance traveled for each reported wheel."]
31049#[derive(Debug, Clone, PartialEq)]
31050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31052pub struct WHEEL_DISTANCE_DATA {
31053 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31054 pub time_usec: u64,
31055 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31057 pub distance: [f64; 16],
31058 #[doc = "Number of wheels reported."]
31059 pub count: u8,
31060}
31061impl WHEEL_DISTANCE_DATA {
31062 pub const ENCODED_LEN: usize = 137usize;
31063 pub const DEFAULT: Self = Self {
31064 time_usec: 0_u64,
31065 distance: [0.0_f64; 16usize],
31066 count: 0_u8,
31067 };
31068 #[cfg(feature = "arbitrary")]
31069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31070 use arbitrary::{Arbitrary, Unstructured};
31071 let mut buf = [0u8; 1024];
31072 rng.fill_bytes(&mut buf);
31073 let mut unstructured = Unstructured::new(&buf);
31074 Self::arbitrary(&mut unstructured).unwrap_or_default()
31075 }
31076}
31077impl Default for WHEEL_DISTANCE_DATA {
31078 fn default() -> Self {
31079 Self::DEFAULT.clone()
31080 }
31081}
31082impl MessageData for WHEEL_DISTANCE_DATA {
31083 type Message = MavMessage;
31084 const ID: u32 = 9000u32;
31085 const NAME: &'static str = "WHEEL_DISTANCE";
31086 const EXTRA_CRC: u8 = 113u8;
31087 const ENCODED_LEN: usize = 137usize;
31088 fn deser(
31089 _version: MavlinkVersion,
31090 __input: &[u8],
31091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31092 let avail_len = __input.len();
31093 let mut payload_buf = [0; Self::ENCODED_LEN];
31094 let mut buf = if avail_len < Self::ENCODED_LEN {
31095 payload_buf[0..avail_len].copy_from_slice(__input);
31096 Bytes::new(&payload_buf)
31097 } else {
31098 Bytes::new(__input)
31099 };
31100 let mut __struct = Self::default();
31101 __struct.time_usec = buf.get_u64_le();
31102 for v in &mut __struct.distance {
31103 let val = buf.get_f64_le();
31104 *v = val;
31105 }
31106 __struct.count = buf.get_u8();
31107 Ok(__struct)
31108 }
31109 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31110 let mut __tmp = BytesMut::new(bytes);
31111 #[allow(clippy::absurd_extreme_comparisons)]
31112 #[allow(unused_comparisons)]
31113 if __tmp.remaining() < Self::ENCODED_LEN {
31114 panic!(
31115 "buffer is too small (need {} bytes, but got {})",
31116 Self::ENCODED_LEN,
31117 __tmp.remaining(),
31118 )
31119 }
31120 __tmp.put_u64_le(self.time_usec);
31121 for val in &self.distance {
31122 __tmp.put_f64_le(*val);
31123 }
31124 __tmp.put_u8(self.count);
31125 if matches!(version, MavlinkVersion::V2) {
31126 let len = __tmp.len();
31127 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31128 } else {
31129 __tmp.len()
31130 }
31131 }
31132}
31133#[doc = "id: 299"]
31134#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31135#[derive(Debug, Clone, PartialEq)]
31136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31138pub struct WIFI_CONFIG_AP_DATA {
31139 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31140 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31141 pub ssid: [u8; 32],
31142 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31143 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31144 pub password: [u8; 64],
31145 #[doc = "WiFi Mode."]
31146 #[cfg_attr(feature = "serde", serde(default))]
31147 pub mode: WifiConfigApMode,
31148 #[doc = "Message acceptance response (sent back to GS)."]
31149 #[cfg_attr(feature = "serde", serde(default))]
31150 pub response: WifiConfigApResponse,
31151}
31152impl WIFI_CONFIG_AP_DATA {
31153 pub const ENCODED_LEN: usize = 98usize;
31154 pub const DEFAULT: Self = Self {
31155 ssid: [0_u8; 32usize],
31156 password: [0_u8; 64usize],
31157 mode: WifiConfigApMode::DEFAULT,
31158 response: WifiConfigApResponse::DEFAULT,
31159 };
31160 #[cfg(feature = "arbitrary")]
31161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31162 use arbitrary::{Arbitrary, Unstructured};
31163 let mut buf = [0u8; 1024];
31164 rng.fill_bytes(&mut buf);
31165 let mut unstructured = Unstructured::new(&buf);
31166 Self::arbitrary(&mut unstructured).unwrap_or_default()
31167 }
31168}
31169impl Default for WIFI_CONFIG_AP_DATA {
31170 fn default() -> Self {
31171 Self::DEFAULT.clone()
31172 }
31173}
31174impl MessageData for WIFI_CONFIG_AP_DATA {
31175 type Message = MavMessage;
31176 const ID: u32 = 299u32;
31177 const NAME: &'static str = "WIFI_CONFIG_AP";
31178 const EXTRA_CRC: u8 = 19u8;
31179 const ENCODED_LEN: usize = 98usize;
31180 fn deser(
31181 _version: MavlinkVersion,
31182 __input: &[u8],
31183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31184 let avail_len = __input.len();
31185 let mut payload_buf = [0; Self::ENCODED_LEN];
31186 let mut buf = if avail_len < Self::ENCODED_LEN {
31187 payload_buf[0..avail_len].copy_from_slice(__input);
31188 Bytes::new(&payload_buf)
31189 } else {
31190 Bytes::new(__input)
31191 };
31192 let mut __struct = Self::default();
31193 for v in &mut __struct.ssid {
31194 let val = buf.get_u8();
31195 *v = val;
31196 }
31197 for v in &mut __struct.password {
31198 let val = buf.get_u8();
31199 *v = val;
31200 }
31201 let tmp = buf.get_i8();
31202 __struct.mode =
31203 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31204 enum_type: "WifiConfigApMode",
31205 value: tmp as u32,
31206 })?;
31207 let tmp = buf.get_i8();
31208 __struct.response =
31209 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31210 enum_type: "WifiConfigApResponse",
31211 value: tmp as u32,
31212 })?;
31213 Ok(__struct)
31214 }
31215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31216 let mut __tmp = BytesMut::new(bytes);
31217 #[allow(clippy::absurd_extreme_comparisons)]
31218 #[allow(unused_comparisons)]
31219 if __tmp.remaining() < Self::ENCODED_LEN {
31220 panic!(
31221 "buffer is too small (need {} bytes, but got {})",
31222 Self::ENCODED_LEN,
31223 __tmp.remaining(),
31224 )
31225 }
31226 for val in &self.ssid {
31227 __tmp.put_u8(*val);
31228 }
31229 for val in &self.password {
31230 __tmp.put_u8(*val);
31231 }
31232 __tmp.put_i8(self.mode as i8);
31233 __tmp.put_i8(self.response as i8);
31234 if matches!(version, MavlinkVersion::V2) {
31235 let len = __tmp.len();
31236 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31237 } else {
31238 __tmp.len()
31239 }
31240 }
31241}
31242#[doc = "id: 9005"]
31243#[doc = "Winch status."]
31244#[derive(Debug, Clone, PartialEq)]
31245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31247pub struct WINCH_STATUS_DATA {
31248 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31249 pub time_usec: u64,
31250 #[doc = "Length of line released. NaN if unknown"]
31251 pub line_length: f32,
31252 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31253 pub speed: f32,
31254 #[doc = "Tension on the line. NaN if unknown"]
31255 pub tension: f32,
31256 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31257 pub voltage: f32,
31258 #[doc = "Current draw from the winch. NaN if unknown"]
31259 pub current: f32,
31260 #[doc = "Status flags"]
31261 pub status: MavWinchStatusFlag,
31262 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31263 pub temperature: i16,
31264}
31265impl WINCH_STATUS_DATA {
31266 pub const ENCODED_LEN: usize = 34usize;
31267 pub const DEFAULT: Self = Self {
31268 time_usec: 0_u64,
31269 line_length: 0.0_f32,
31270 speed: 0.0_f32,
31271 tension: 0.0_f32,
31272 voltage: 0.0_f32,
31273 current: 0.0_f32,
31274 status: MavWinchStatusFlag::DEFAULT,
31275 temperature: 0_i16,
31276 };
31277 #[cfg(feature = "arbitrary")]
31278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31279 use arbitrary::{Arbitrary, Unstructured};
31280 let mut buf = [0u8; 1024];
31281 rng.fill_bytes(&mut buf);
31282 let mut unstructured = Unstructured::new(&buf);
31283 Self::arbitrary(&mut unstructured).unwrap_or_default()
31284 }
31285}
31286impl Default for WINCH_STATUS_DATA {
31287 fn default() -> Self {
31288 Self::DEFAULT.clone()
31289 }
31290}
31291impl MessageData for WINCH_STATUS_DATA {
31292 type Message = MavMessage;
31293 const ID: u32 = 9005u32;
31294 const NAME: &'static str = "WINCH_STATUS";
31295 const EXTRA_CRC: u8 = 117u8;
31296 const ENCODED_LEN: usize = 34usize;
31297 fn deser(
31298 _version: MavlinkVersion,
31299 __input: &[u8],
31300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31301 let avail_len = __input.len();
31302 let mut payload_buf = [0; Self::ENCODED_LEN];
31303 let mut buf = if avail_len < Self::ENCODED_LEN {
31304 payload_buf[0..avail_len].copy_from_slice(__input);
31305 Bytes::new(&payload_buf)
31306 } else {
31307 Bytes::new(__input)
31308 };
31309 let mut __struct = Self::default();
31310 __struct.time_usec = buf.get_u64_le();
31311 __struct.line_length = buf.get_f32_le();
31312 __struct.speed = buf.get_f32_le();
31313 __struct.tension = buf.get_f32_le();
31314 __struct.voltage = buf.get_f32_le();
31315 __struct.current = buf.get_f32_le();
31316 let tmp = buf.get_u32_le();
31317 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31318 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31319 flag_type: "MavWinchStatusFlag",
31320 value: tmp as u32,
31321 })?;
31322 __struct.temperature = buf.get_i16_le();
31323 Ok(__struct)
31324 }
31325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31326 let mut __tmp = BytesMut::new(bytes);
31327 #[allow(clippy::absurd_extreme_comparisons)]
31328 #[allow(unused_comparisons)]
31329 if __tmp.remaining() < Self::ENCODED_LEN {
31330 panic!(
31331 "buffer is too small (need {} bytes, but got {})",
31332 Self::ENCODED_LEN,
31333 __tmp.remaining(),
31334 )
31335 }
31336 __tmp.put_u64_le(self.time_usec);
31337 __tmp.put_f32_le(self.line_length);
31338 __tmp.put_f32_le(self.speed);
31339 __tmp.put_f32_le(self.tension);
31340 __tmp.put_f32_le(self.voltage);
31341 __tmp.put_f32_le(self.current);
31342 __tmp.put_u32_le(self.status.bits());
31343 __tmp.put_i16_le(self.temperature);
31344 if matches!(version, MavlinkVersion::V2) {
31345 let len = __tmp.len();
31346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31347 } else {
31348 __tmp.len()
31349 }
31350 }
31351}
31352#[doc = "id: 231"]
31353#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31354#[derive(Debug, Clone, PartialEq)]
31355#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31356#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31357pub struct WIND_COV_DATA {
31358 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31359 pub time_usec: u64,
31360 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31361 pub wind_x: f32,
31362 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31363 pub wind_y: f32,
31364 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31365 pub wind_z: f32,
31366 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31367 pub var_horiz: f32,
31368 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31369 pub var_vert: f32,
31370 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31371 pub wind_alt: f32,
31372 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31373 pub horiz_accuracy: f32,
31374 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31375 pub vert_accuracy: f32,
31376}
31377impl WIND_COV_DATA {
31378 pub const ENCODED_LEN: usize = 40usize;
31379 pub const DEFAULT: Self = Self {
31380 time_usec: 0_u64,
31381 wind_x: 0.0_f32,
31382 wind_y: 0.0_f32,
31383 wind_z: 0.0_f32,
31384 var_horiz: 0.0_f32,
31385 var_vert: 0.0_f32,
31386 wind_alt: 0.0_f32,
31387 horiz_accuracy: 0.0_f32,
31388 vert_accuracy: 0.0_f32,
31389 };
31390 #[cfg(feature = "arbitrary")]
31391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31392 use arbitrary::{Arbitrary, Unstructured};
31393 let mut buf = [0u8; 1024];
31394 rng.fill_bytes(&mut buf);
31395 let mut unstructured = Unstructured::new(&buf);
31396 Self::arbitrary(&mut unstructured).unwrap_or_default()
31397 }
31398}
31399impl Default for WIND_COV_DATA {
31400 fn default() -> Self {
31401 Self::DEFAULT.clone()
31402 }
31403}
31404impl MessageData for WIND_COV_DATA {
31405 type Message = MavMessage;
31406 const ID: u32 = 231u32;
31407 const NAME: &'static str = "WIND_COV";
31408 const EXTRA_CRC: u8 = 105u8;
31409 const ENCODED_LEN: usize = 40usize;
31410 fn deser(
31411 _version: MavlinkVersion,
31412 __input: &[u8],
31413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31414 let avail_len = __input.len();
31415 let mut payload_buf = [0; Self::ENCODED_LEN];
31416 let mut buf = if avail_len < Self::ENCODED_LEN {
31417 payload_buf[0..avail_len].copy_from_slice(__input);
31418 Bytes::new(&payload_buf)
31419 } else {
31420 Bytes::new(__input)
31421 };
31422 let mut __struct = Self::default();
31423 __struct.time_usec = buf.get_u64_le();
31424 __struct.wind_x = buf.get_f32_le();
31425 __struct.wind_y = buf.get_f32_le();
31426 __struct.wind_z = buf.get_f32_le();
31427 __struct.var_horiz = buf.get_f32_le();
31428 __struct.var_vert = buf.get_f32_le();
31429 __struct.wind_alt = buf.get_f32_le();
31430 __struct.horiz_accuracy = buf.get_f32_le();
31431 __struct.vert_accuracy = buf.get_f32_le();
31432 Ok(__struct)
31433 }
31434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31435 let mut __tmp = BytesMut::new(bytes);
31436 #[allow(clippy::absurd_extreme_comparisons)]
31437 #[allow(unused_comparisons)]
31438 if __tmp.remaining() < Self::ENCODED_LEN {
31439 panic!(
31440 "buffer is too small (need {} bytes, but got {})",
31441 Self::ENCODED_LEN,
31442 __tmp.remaining(),
31443 )
31444 }
31445 __tmp.put_u64_le(self.time_usec);
31446 __tmp.put_f32_le(self.wind_x);
31447 __tmp.put_f32_le(self.wind_y);
31448 __tmp.put_f32_le(self.wind_z);
31449 __tmp.put_f32_le(self.var_horiz);
31450 __tmp.put_f32_le(self.var_vert);
31451 __tmp.put_f32_le(self.wind_alt);
31452 __tmp.put_f32_le(self.horiz_accuracy);
31453 __tmp.put_f32_le(self.vert_accuracy);
31454 if matches!(version, MavlinkVersion::V2) {
31455 let len = __tmp.len();
31456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31457 } else {
31458 __tmp.len()
31459 }
31460 }
31461}
31462#[derive(Clone, PartialEq, Debug)]
31463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31464#[cfg_attr(feature = "serde", serde(tag = "type"))]
31465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31466#[repr(u32)]
31467pub enum MavMessage {
31468 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31469 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31470 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31471 AIS_VESSEL(AIS_VESSEL_DATA),
31472 ALTITUDE(ALTITUDE_DATA),
31473 ATTITUDE(ATTITUDE_DATA),
31474 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31475 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31476 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31477 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31478 AUTH_KEY(AUTH_KEY_DATA),
31479 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31480 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31481 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31482 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31483 AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA),
31484 AVSS_DRONE_OPERATION_MODE(AVSS_DRONE_OPERATION_MODE_DATA),
31485 AVSS_DRONE_POSITION(AVSS_DRONE_POSITION_DATA),
31486 AVSS_PRS_SYS_STATUS(AVSS_PRS_SYS_STATUS_DATA),
31487 BATTERY_INFO(BATTERY_INFO_DATA),
31488 BATTERY_STATUS(BATTERY_STATUS_DATA),
31489 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31490 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31491 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31492 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31493 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31494 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31495 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31496 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31497 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31498 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31499 CANFD_FRAME(CANFD_FRAME_DATA),
31500 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31501 CAN_FRAME(CAN_FRAME_DATA),
31502 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31503 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31504 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31505 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31506 COLLISION(COLLISION_DATA),
31507 COMMAND_ACK(COMMAND_ACK_DATA),
31508 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31509 COMMAND_INT(COMMAND_INT_DATA),
31510 COMMAND_LONG(COMMAND_LONG_DATA),
31511 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31512 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31513 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31514 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31515 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31516 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31517 CURRENT_MODE(CURRENT_MODE_DATA),
31518 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31519 DATA_STREAM(DATA_STREAM_DATA),
31520 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31521 DEBUG(DEBUG_DATA),
31522 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31523 DEBUG_VECT(DEBUG_VECT_DATA),
31524 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31525 EFI_STATUS(EFI_STATUS_DATA),
31526 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31527 ESC_INFO(ESC_INFO_DATA),
31528 ESC_STATUS(ESC_STATUS_DATA),
31529 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31530 EVENT(EVENT_DATA),
31531 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31532 FENCE_STATUS(FENCE_STATUS_DATA),
31533 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31534 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31535 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31536 FUEL_STATUS(FUEL_STATUS_DATA),
31537 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31538 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31539 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31540 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31541 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31542 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31543 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31544 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31545 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31546 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31547 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31548 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31549 GPS2_RAW(GPS2_RAW_DATA),
31550 GPS2_RTK(GPS2_RTK_DATA),
31551 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31552 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
31553 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31554 GPS_INPUT(GPS_INPUT_DATA),
31555 GPS_RAW_INT(GPS_RAW_INT_DATA),
31556 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31557 GPS_RTK(GPS_RTK_DATA),
31558 GPS_STATUS(GPS_STATUS_DATA),
31559 HEARTBEAT(HEARTBEAT_DATA),
31560 HIGHRES_IMU(HIGHRES_IMU_DATA),
31561 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
31562 HIGH_LATENCY(HIGH_LATENCY_DATA),
31563 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31564 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31565 HIL_CONTROLS(HIL_CONTROLS_DATA),
31566 HIL_GPS(HIL_GPS_DATA),
31567 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31568 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31569 HIL_SENSOR(HIL_SENSOR_DATA),
31570 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
31571 HIL_STATE(HIL_STATE_DATA),
31572 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31573 HOME_POSITION(HOME_POSITION_DATA),
31574 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
31575 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
31576 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
31577 LANDING_TARGET(LANDING_TARGET_DATA),
31578 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
31579 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
31580 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
31581 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
31582 LOGGING_ACK(LOGGING_ACK_DATA),
31583 LOGGING_DATA(LOGGING_DATA_DATA),
31584 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
31585 LOG_DATA(LOG_DATA_DATA),
31586 LOG_ENTRY(LOG_ENTRY_DATA),
31587 LOG_ERASE(LOG_ERASE_DATA),
31588 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
31589 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
31590 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
31591 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
31592 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
31593 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
31594 MEMORY_VECT(MEMORY_VECT_DATA),
31595 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
31596 MISSION_ACK(MISSION_ACK_DATA),
31597 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
31598 MISSION_COUNT(MISSION_COUNT_DATA),
31599 MISSION_CURRENT(MISSION_CURRENT_DATA),
31600 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
31601 MISSION_ITEM(MISSION_ITEM_DATA),
31602 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
31603 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
31604 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
31605 MISSION_REQUEST(MISSION_REQUEST_DATA),
31606 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
31607 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
31608 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
31609 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
31610 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
31611 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
31612 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
31613 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
31614 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
31615 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
31616 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
31617 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
31618 ODOMETRY(ODOMETRY_DATA),
31619 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
31620 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
31621 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
31622 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
31623 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
31624 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
31625 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
31626 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
31627 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
31628 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
31629 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
31630 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
31631 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
31632 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
31633 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
31634 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
31635 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
31636 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
31637 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
31638 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
31639 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
31640 PARAM_SET(PARAM_SET_DATA),
31641 PARAM_VALUE(PARAM_VALUE_DATA),
31642 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
31643 PING(PING_DATA),
31644 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
31645 PLAY_TUNE(PLAY_TUNE_DATA),
31646 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
31647 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
31648 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
31649 POWER_STATUS(POWER_STATUS_DATA),
31650 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
31651 RADIO_STATUS(RADIO_STATUS_DATA),
31652 RAW_IMU(RAW_IMU_DATA),
31653 RAW_PRESSURE(RAW_PRESSURE_DATA),
31654 RAW_RPM(RAW_RPM_DATA),
31655 RC_CHANNELS(RC_CHANNELS_DATA),
31656 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
31657 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
31658 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
31659 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
31660 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
31661 REQUEST_EVENT(REQUEST_EVENT_DATA),
31662 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
31663 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
31664 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
31665 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
31666 SCALED_IMU(SCALED_IMU_DATA),
31667 SCALED_IMU2(SCALED_IMU2_DATA),
31668 SCALED_IMU3(SCALED_IMU3_DATA),
31669 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
31670 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
31671 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
31672 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
31673 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
31674 SETUP_SIGNING(SETUP_SIGNING_DATA),
31675 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
31676 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
31677 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
31678 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
31679 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
31680 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
31681 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
31682 SET_MODE(SET_MODE_DATA),
31683 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
31684 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
31685 SIM_STATE(SIM_STATE_DATA),
31686 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
31687 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
31688 STATUSTEXT(STATUSTEXT_DATA),
31689 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
31690 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
31691 SYSTEM_TIME(SYSTEM_TIME_DATA),
31692 SYS_STATUS(SYS_STATUS_DATA),
31693 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
31694 TERRAIN_DATA(TERRAIN_DATA_DATA),
31695 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
31696 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
31697 TIMESYNC(TIMESYNC_DATA),
31698 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
31699 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
31700 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
31701 TUNNEL(TUNNEL_DATA),
31702 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
31703 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
31704 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
31705 V2_EXTENSION(V2_EXTENSION_DATA),
31706 VFR_HUD(VFR_HUD_DATA),
31707 VIBRATION(VIBRATION_DATA),
31708 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
31709 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
31710 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
31711 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
31712 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
31713 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
31714 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
31715 WINCH_STATUS(WINCH_STATUS_DATA),
31716 WIND_COV(WIND_COV_DATA),
31717}
31718impl MavMessage {
31719 pub const fn all_ids() -> &'static [u32] {
31720 &[
31721 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
31722 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
31723 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
31724 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
31725 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
31726 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
31727 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
31728 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
31729 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
31730 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
31731 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
31732 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
31733 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
31734 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
31735 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
31736 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
31737 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
31738 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
31739 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
31740 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
31741 12915u32, 12918u32, 12919u32, 12920u32, 60050u32, 60051u32, 60052u32, 60053u32,
31742 ]
31743 }
31744}
31745impl Message for MavMessage {
31746 fn parse(
31747 version: MavlinkVersion,
31748 id: u32,
31749 payload: &[u8],
31750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31751 match id {
31752 ACTUATOR_CONTROL_TARGET_DATA::ID => {
31753 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
31754 .map(Self::ACTUATOR_CONTROL_TARGET)
31755 }
31756 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
31757 .map(Self::ACTUATOR_OUTPUT_STATUS),
31758 ADSB_VEHICLE_DATA::ID => {
31759 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
31760 }
31761 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
31762 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
31763 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
31764 ATTITUDE_QUATERNION_DATA::ID => {
31765 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
31766 }
31767 ATTITUDE_QUATERNION_COV_DATA::ID => {
31768 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
31769 .map(Self::ATTITUDE_QUATERNION_COV)
31770 }
31771 ATTITUDE_TARGET_DATA::ID => {
31772 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
31773 }
31774 ATT_POS_MOCAP_DATA::ID => {
31775 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
31776 }
31777 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
31778 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
31779 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
31780 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
31781 }
31782 AUTOPILOT_VERSION_DATA::ID => {
31783 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
31784 }
31785 AVAILABLE_MODES_DATA::ID => {
31786 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
31787 }
31788 AVAILABLE_MODES_MONITOR_DATA::ID => {
31789 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
31790 .map(Self::AVAILABLE_MODES_MONITOR)
31791 }
31792 AVSS_DRONE_IMU_DATA::ID => {
31793 AVSS_DRONE_IMU_DATA::deser(version, payload).map(Self::AVSS_DRONE_IMU)
31794 }
31795 AVSS_DRONE_OPERATION_MODE_DATA::ID => {
31796 AVSS_DRONE_OPERATION_MODE_DATA::deser(version, payload)
31797 .map(Self::AVSS_DRONE_OPERATION_MODE)
31798 }
31799 AVSS_DRONE_POSITION_DATA::ID => {
31800 AVSS_DRONE_POSITION_DATA::deser(version, payload).map(Self::AVSS_DRONE_POSITION)
31801 }
31802 AVSS_PRS_SYS_STATUS_DATA::ID => {
31803 AVSS_PRS_SYS_STATUS_DATA::deser(version, payload).map(Self::AVSS_PRS_SYS_STATUS)
31804 }
31805 BATTERY_INFO_DATA::ID => {
31806 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
31807 }
31808 BATTERY_STATUS_DATA::ID => {
31809 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
31810 }
31811 BUTTON_CHANGE_DATA::ID => {
31812 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
31813 }
31814 CAMERA_CAPTURE_STATUS_DATA::ID => {
31815 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
31816 }
31817 CAMERA_FOV_STATUS_DATA::ID => {
31818 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
31819 }
31820 CAMERA_IMAGE_CAPTURED_DATA::ID => {
31821 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
31822 }
31823 CAMERA_INFORMATION_DATA::ID => {
31824 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
31825 }
31826 CAMERA_SETTINGS_DATA::ID => {
31827 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
31828 }
31829 CAMERA_THERMAL_RANGE_DATA::ID => {
31830 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
31831 }
31832 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
31833 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
31834 .map(Self::CAMERA_TRACKING_GEO_STATUS)
31835 }
31836 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
31837 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
31838 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
31839 }
31840 CAMERA_TRIGGER_DATA::ID => {
31841 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
31842 }
31843 CANFD_FRAME_DATA::ID => {
31844 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
31845 }
31846 CAN_FILTER_MODIFY_DATA::ID => {
31847 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
31848 }
31849 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
31850 CELLULAR_CONFIG_DATA::ID => {
31851 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
31852 }
31853 CELLULAR_STATUS_DATA::ID => {
31854 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
31855 }
31856 CHANGE_OPERATOR_CONTROL_DATA::ID => {
31857 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
31858 .map(Self::CHANGE_OPERATOR_CONTROL)
31859 }
31860 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
31861 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
31862 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
31863 }
31864 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
31865 COMMAND_ACK_DATA::ID => {
31866 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
31867 }
31868 COMMAND_CANCEL_DATA::ID => {
31869 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
31870 }
31871 COMMAND_INT_DATA::ID => {
31872 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
31873 }
31874 COMMAND_LONG_DATA::ID => {
31875 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
31876 }
31877 COMPONENT_INFORMATION_DATA::ID => {
31878 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
31879 }
31880 COMPONENT_INFORMATION_BASIC_DATA::ID => {
31881 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
31882 .map(Self::COMPONENT_INFORMATION_BASIC)
31883 }
31884 COMPONENT_METADATA_DATA::ID => {
31885 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
31886 }
31887 CONTROL_SYSTEM_STATE_DATA::ID => {
31888 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
31889 }
31890 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
31891 .map(Self::CURRENT_EVENT_SEQUENCE),
31892 CURRENT_MODE_DATA::ID => {
31893 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
31894 }
31895 DATA_STREAM_DATA::ID => {
31896 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
31897 }
31898 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
31899 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
31900 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
31901 }
31902 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
31903 DEBUG_FLOAT_ARRAY_DATA::ID => {
31904 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
31905 }
31906 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
31907 DISTANCE_SENSOR_DATA::ID => {
31908 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
31909 }
31910 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
31911 ENCAPSULATED_DATA_DATA::ID => {
31912 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
31913 }
31914 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
31915 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
31916 ESTIMATOR_STATUS_DATA::ID => {
31917 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
31918 }
31919 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
31920 EXTENDED_SYS_STATE_DATA::ID => {
31921 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
31922 }
31923 FENCE_STATUS_DATA::ID => {
31924 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
31925 }
31926 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
31927 .map(Self::FILE_TRANSFER_PROTOCOL),
31928 FLIGHT_INFORMATION_DATA::ID => {
31929 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
31930 }
31931 FOLLOW_TARGET_DATA::ID => {
31932 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
31933 }
31934 FUEL_STATUS_DATA::ID => {
31935 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
31936 }
31937 GENERATOR_STATUS_DATA::ID => {
31938 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
31939 }
31940 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
31941 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
31942 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
31943 }
31944 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
31945 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
31946 .map(Self::GIMBAL_DEVICE_INFORMATION)
31947 }
31948 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
31949 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
31950 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
31951 }
31952 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
31953 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
31954 .map(Self::GIMBAL_MANAGER_INFORMATION)
31955 }
31956 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
31957 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
31958 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
31959 }
31960 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
31961 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
31962 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
31963 }
31964 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
31965 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
31966 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
31967 }
31968 GIMBAL_MANAGER_STATUS_DATA::ID => {
31969 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
31970 }
31971 GLOBAL_POSITION_INT_DATA::ID => {
31972 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
31973 }
31974 GLOBAL_POSITION_INT_COV_DATA::ID => {
31975 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
31976 .map(Self::GLOBAL_POSITION_INT_COV)
31977 }
31978 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
31979 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
31980 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
31981 }
31982 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
31983 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
31984 GPS_GLOBAL_ORIGIN_DATA::ID => {
31985 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
31986 }
31987 GPS_INJECT_DATA_DATA::ID => {
31988 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
31989 }
31990 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
31991 GPS_RAW_INT_DATA::ID => {
31992 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
31993 }
31994 GPS_RTCM_DATA_DATA::ID => {
31995 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
31996 }
31997 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
31998 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
31999 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
32000 HIGHRES_IMU_DATA::ID => {
32001 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
32002 }
32003 HIGH_LATENCY_DATA::ID => {
32004 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32005 }
32006 HIGH_LATENCY2_DATA::ID => {
32007 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32008 }
32009 HIL_ACTUATOR_CONTROLS_DATA::ID => {
32010 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
32011 }
32012 HIL_CONTROLS_DATA::ID => {
32013 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
32014 }
32015 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32016 HIL_OPTICAL_FLOW_DATA::ID => {
32017 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32018 }
32019 HIL_RC_INPUTS_RAW_DATA::ID => {
32020 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32021 }
32022 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32023 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32024 HIL_STATE_QUATERNION_DATA::ID => {
32025 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32026 }
32027 HOME_POSITION_DATA::ID => {
32028 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
32029 }
32030 HYGROMETER_SENSOR_DATA::ID => {
32031 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
32032 }
32033 ILLUMINATOR_STATUS_DATA::ID => {
32034 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32035 }
32036 ISBD_LINK_STATUS_DATA::ID => {
32037 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
32038 }
32039 LANDING_TARGET_DATA::ID => {
32040 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
32041 }
32042 LINK_NODE_STATUS_DATA::ID => {
32043 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32044 }
32045 LOCAL_POSITION_NED_DATA::ID => {
32046 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32047 }
32048 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
32049 .map(Self::LOCAL_POSITION_NED_COV),
32050 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32051 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32052 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32053 }
32054 LOGGING_ACK_DATA::ID => {
32055 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32056 }
32057 LOGGING_DATA_DATA::ID => {
32058 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
32059 }
32060 LOGGING_DATA_ACKED_DATA::ID => {
32061 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32062 }
32063 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
32064 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32065 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32066 LOG_REQUEST_DATA_DATA::ID => {
32067 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
32068 }
32069 LOG_REQUEST_END_DATA::ID => {
32070 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
32071 }
32072 LOG_REQUEST_LIST_DATA::ID => {
32073 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
32074 }
32075 MAG_CAL_REPORT_DATA::ID => {
32076 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
32077 }
32078 MANUAL_CONTROL_DATA::ID => {
32079 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
32080 }
32081 MANUAL_SETPOINT_DATA::ID => {
32082 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
32083 }
32084 MEMORY_VECT_DATA::ID => {
32085 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
32086 }
32087 MESSAGE_INTERVAL_DATA::ID => {
32088 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
32089 }
32090 MISSION_ACK_DATA::ID => {
32091 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
32092 }
32093 MISSION_CLEAR_ALL_DATA::ID => {
32094 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
32095 }
32096 MISSION_COUNT_DATA::ID => {
32097 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
32098 }
32099 MISSION_CURRENT_DATA::ID => {
32100 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
32101 }
32102 MISSION_ITEM_DATA::ID => {
32103 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
32104 }
32105 MISSION_ITEM_INT_DATA::ID => {
32106 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
32107 }
32108 MISSION_ITEM_REACHED_DATA::ID => {
32109 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
32110 }
32111 MISSION_REQUEST_DATA::ID => {
32112 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32113 }
32114 MISSION_REQUEST_INT_DATA::ID => {
32115 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
32116 }
32117 MISSION_REQUEST_LIST_DATA::ID => {
32118 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32119 }
32120 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32121 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32122 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32123 }
32124 MISSION_SET_CURRENT_DATA::ID => {
32125 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
32126 }
32127 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
32128 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
32129 .map(Self::MISSION_WRITE_PARTIAL_LIST)
32130 }
32131 MOUNT_ORIENTATION_DATA::ID => {
32132 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32133 }
32134 NAMED_VALUE_FLOAT_DATA::ID => {
32135 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
32136 }
32137 NAMED_VALUE_INT_DATA::ID => {
32138 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32139 }
32140 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32141 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32142 }
32143 OBSTACLE_DISTANCE_DATA::ID => {
32144 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32145 }
32146 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
32147 ONBOARD_COMPUTER_STATUS_DATA::ID => {
32148 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
32149 .map(Self::ONBOARD_COMPUTER_STATUS)
32150 }
32151 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
32152 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
32153 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
32154 }
32155 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
32156 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
32157 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
32158 }
32159 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32160 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32161 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
32162 .map(Self::OPEN_DRONE_ID_LOCATION),
32163 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
32164 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
32165 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
32166 }
32167 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32168 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32169 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32170 }
32171 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
32172 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
32173 }
32174 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32175 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32176 }
32177 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
32178 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
32179 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
32180 }
32181 OPTICAL_FLOW_DATA::ID => {
32182 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32183 }
32184 OPTICAL_FLOW_RAD_DATA::ID => {
32185 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
32186 }
32187 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
32188 .map(Self::ORBIT_EXECUTION_STATUS),
32189 PARAM_EXT_ACK_DATA::ID => {
32190 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
32191 }
32192 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
32193 .map(Self::PARAM_EXT_REQUEST_LIST),
32194 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32195 .map(Self::PARAM_EXT_REQUEST_READ),
32196 PARAM_EXT_SET_DATA::ID => {
32197 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32198 }
32199 PARAM_EXT_VALUE_DATA::ID => {
32200 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32201 }
32202 PARAM_MAP_RC_DATA::ID => {
32203 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32204 }
32205 PARAM_REQUEST_LIST_DATA::ID => {
32206 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
32207 }
32208 PARAM_REQUEST_READ_DATA::ID => {
32209 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32210 }
32211 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32212 PARAM_VALUE_DATA::ID => {
32213 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32214 }
32215 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32216 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
32217 PLAY_TUNE_V2_DATA::ID => {
32218 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
32219 }
32220 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32221 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32222 .map(Self::POSITION_TARGET_GLOBAL_INT)
32223 }
32224 POSITION_TARGET_LOCAL_NED_DATA::ID => {
32225 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32226 .map(Self::POSITION_TARGET_LOCAL_NED)
32227 }
32228 POWER_STATUS_DATA::ID => {
32229 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32230 }
32231 PROTOCOL_VERSION_DATA::ID => {
32232 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32233 }
32234 RADIO_STATUS_DATA::ID => {
32235 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32236 }
32237 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
32238 RAW_PRESSURE_DATA::ID => {
32239 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
32240 }
32241 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
32242 RC_CHANNELS_DATA::ID => {
32243 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
32244 }
32245 RC_CHANNELS_OVERRIDE_DATA::ID => {
32246 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32247 }
32248 RC_CHANNELS_RAW_DATA::ID => {
32249 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32250 }
32251 RC_CHANNELS_SCALED_DATA::ID => {
32252 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
32253 }
32254 REQUEST_DATA_STREAM_DATA::ID => {
32255 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
32256 }
32257 REQUEST_EVENT_DATA::ID => {
32258 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32259 }
32260 RESOURCE_REQUEST_DATA::ID => {
32261 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32262 }
32263 RESPONSE_EVENT_ERROR_DATA::ID => {
32264 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32265 }
32266 SAFETY_ALLOWED_AREA_DATA::ID => {
32267 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32268 }
32269 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
32270 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
32271 .map(Self::SAFETY_SET_ALLOWED_AREA)
32272 }
32273 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
32274 SCALED_IMU2_DATA::ID => {
32275 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32276 }
32277 SCALED_IMU3_DATA::ID => {
32278 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32279 }
32280 SCALED_PRESSURE_DATA::ID => {
32281 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
32282 }
32283 SCALED_PRESSURE2_DATA::ID => {
32284 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
32285 }
32286 SCALED_PRESSURE3_DATA::ID => {
32287 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
32288 }
32289 SERIAL_CONTROL_DATA::ID => {
32290 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32291 }
32292 SERVO_OUTPUT_RAW_DATA::ID => {
32293 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
32294 }
32295 SETUP_SIGNING_DATA::ID => {
32296 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32297 }
32298 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
32299 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32300 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
32301 }
32302 SET_ATTITUDE_TARGET_DATA::ID => {
32303 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32304 }
32305 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32306 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32307 }
32308 SET_HOME_POSITION_DATA::ID => {
32309 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32310 }
32311 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
32312 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32313 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32314 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
32315 }
32316 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
32317 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32318 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
32319 }
32320 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32321 SMART_BATTERY_INFO_DATA::ID => {
32322 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
32323 }
32324 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
32325 STORAGE_INFORMATION_DATA::ID => {
32326 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
32327 }
32328 SUPPORTED_TUNES_DATA::ID => {
32329 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32330 }
32331 SYSTEM_TIME_DATA::ID => {
32332 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
32333 }
32334 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32335 TERRAIN_CHECK_DATA::ID => {
32336 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
32337 }
32338 TERRAIN_DATA_DATA::ID => {
32339 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32340 }
32341 TERRAIN_REPORT_DATA::ID => {
32342 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
32343 }
32344 TERRAIN_REQUEST_DATA::ID => {
32345 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
32346 }
32347 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32348 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
32349 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
32350 .map(Self::TIME_ESTIMATE_TO_TARGET)
32351 }
32352 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32353 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32354 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32355 }
32356 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32357 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32358 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32359 }
32360 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32361 UAVCAN_NODE_INFO_DATA::ID => {
32362 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
32363 }
32364 UAVCAN_NODE_STATUS_DATA::ID => {
32365 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32366 }
32367 UTM_GLOBAL_POSITION_DATA::ID => {
32368 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
32369 }
32370 V2_EXTENSION_DATA::ID => {
32371 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
32372 }
32373 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
32374 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32375 VICON_POSITION_ESTIMATE_DATA::ID => {
32376 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32377 .map(Self::VICON_POSITION_ESTIMATE)
32378 }
32379 VIDEO_STREAM_INFORMATION_DATA::ID => {
32380 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32381 .map(Self::VIDEO_STREAM_INFORMATION)
32382 }
32383 VIDEO_STREAM_STATUS_DATA::ID => {
32384 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
32385 }
32386 VISION_POSITION_ESTIMATE_DATA::ID => {
32387 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32388 .map(Self::VISION_POSITION_ESTIMATE)
32389 }
32390 VISION_SPEED_ESTIMATE_DATA::ID => {
32391 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32392 }
32393 WHEEL_DISTANCE_DATA::ID => {
32394 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
32395 }
32396 WIFI_CONFIG_AP_DATA::ID => {
32397 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32398 }
32399 WINCH_STATUS_DATA::ID => {
32400 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
32401 }
32402 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
32403 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32404 }
32405 }
32406 fn message_name(&self) -> &'static str {
32407 match self {
32408 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32409 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32410 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32411 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32412 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
32413 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
32414 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
32415 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
32416 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
32417 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
32418 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
32419 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32420 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
32421 }
32422 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
32423 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
32424 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
32425 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::NAME,
32426 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::NAME,
32427 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::NAME,
32428 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::NAME,
32429 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
32430 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
32431 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
32432 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
32433 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
32434 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
32435 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
32436 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
32437 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
32438 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
32439 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
32440 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
32441 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
32442 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
32443 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
32444 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
32445 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
32446 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
32447 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
32448 Self::COLLISION(..) => COLLISION_DATA::NAME,
32449 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
32450 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
32451 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
32452 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
32453 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
32454 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
32455 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
32456 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
32457 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
32458 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
32459 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
32460 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
32461 Self::DEBUG(..) => DEBUG_DATA::NAME,
32462 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
32463 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
32464 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
32465 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
32466 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
32467 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
32468 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
32469 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
32470 Self::EVENT(..) => EVENT_DATA::NAME,
32471 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
32472 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
32473 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
32474 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
32475 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
32476 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
32477 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
32478 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
32479 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
32480 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
32481 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
32482 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
32483 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32484 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
32485 }
32486 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
32487 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
32488 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
32489 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
32490 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
32491 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
32492 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
32493 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
32494 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
32495 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
32496 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
32497 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
32498 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
32499 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
32500 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
32501 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
32502 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
32503 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
32504 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
32505 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
32506 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
32507 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
32508 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
32509 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
32510 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
32511 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
32512 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
32513 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
32514 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
32515 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
32516 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
32517 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
32518 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
32519 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
32520 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32521 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
32522 }
32523 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
32524 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
32525 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
32526 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
32527 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
32528 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
32529 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
32530 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
32531 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
32532 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
32533 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
32534 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
32535 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
32536 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
32537 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
32538 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
32539 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
32540 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
32541 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
32542 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
32543 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
32544 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
32545 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
32546 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
32547 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
32548 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
32549 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
32550 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
32551 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
32552 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
32553 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
32554 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
32555 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
32556 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
32557 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
32558 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
32559 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
32560 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
32561 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
32562 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
32563 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
32564 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
32565 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
32566 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
32567 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
32568 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
32569 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
32570 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
32571 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
32572 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
32573 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
32574 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
32575 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
32576 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
32577 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
32578 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
32579 Self::PING(..) => PING_DATA::NAME,
32580 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
32581 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
32582 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32583 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
32584 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
32585 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
32586 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
32587 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
32588 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
32589 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
32590 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
32591 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
32592 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
32593 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
32594 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
32595 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
32596 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
32597 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
32598 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
32599 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
32600 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
32601 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
32602 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
32603 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
32604 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
32605 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
32606 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
32607 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
32608 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
32609 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
32610 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
32611 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
32612 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
32613 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
32614 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32615 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
32616 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
32617 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
32618 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
32619 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
32620 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
32621 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
32622 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
32623 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
32624 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
32625 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
32626 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
32627 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
32628 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
32629 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
32630 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
32631 }
32632 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32633 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
32634 }
32635 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
32636 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
32637 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
32638 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
32639 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
32640 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
32641 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
32642 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
32643 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
32644 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
32645 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
32646 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
32647 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
32648 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
32649 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
32650 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
32651 }
32652 }
32653 fn message_id(&self) -> u32 {
32654 match self {
32655 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
32656 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
32657 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
32658 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
32659 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
32660 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
32661 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
32662 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
32663 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
32664 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
32665 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
32666 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32667 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
32668 }
32669 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
32670 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
32671 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
32672 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::ID,
32673 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::ID,
32674 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::ID,
32675 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::ID,
32676 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
32677 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
32678 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
32679 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
32680 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
32681 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
32682 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
32683 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
32684 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
32685 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
32686 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
32687 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
32688 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
32689 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
32690 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
32691 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
32692 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
32693 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
32694 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
32695 Self::COLLISION(..) => COLLISION_DATA::ID,
32696 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
32697 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
32698 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
32699 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
32700 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
32701 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
32702 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
32703 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
32704 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
32705 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
32706 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
32707 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
32708 Self::DEBUG(..) => DEBUG_DATA::ID,
32709 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
32710 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
32711 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
32712 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
32713 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
32714 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
32715 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
32716 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
32717 Self::EVENT(..) => EVENT_DATA::ID,
32718 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
32719 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
32720 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
32721 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
32722 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
32723 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
32724 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
32725 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
32726 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
32727 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
32728 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
32729 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
32730 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32731 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
32732 }
32733 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
32734 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
32735 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
32736 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
32737 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
32738 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
32739 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
32740 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
32741 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
32742 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
32743 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
32744 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
32745 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
32746 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
32747 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
32748 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
32749 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
32750 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
32751 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
32752 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
32753 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
32754 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
32755 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
32756 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
32757 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
32758 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
32759 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
32760 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
32761 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
32762 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
32763 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
32764 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
32765 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
32766 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
32767 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32768 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
32769 }
32770 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
32771 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
32772 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
32773 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
32774 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
32775 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
32776 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
32777 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
32778 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
32779 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
32780 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
32781 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
32782 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
32783 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
32784 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
32785 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
32786 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
32787 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
32788 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
32789 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
32790 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
32791 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
32792 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
32793 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
32794 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
32795 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
32796 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
32797 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
32798 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
32799 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
32800 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
32801 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
32802 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
32803 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
32804 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
32805 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
32806 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
32807 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
32808 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
32809 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
32810 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
32811 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
32812 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
32813 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
32814 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
32815 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
32816 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
32817 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
32818 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
32819 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
32820 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
32821 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
32822 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
32823 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
32824 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
32825 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
32826 Self::PING(..) => PING_DATA::ID,
32827 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
32828 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
32829 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
32830 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
32831 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
32832 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
32833 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
32834 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
32835 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
32836 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
32837 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
32838 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
32839 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
32840 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
32841 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
32842 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
32843 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
32844 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
32845 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
32846 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
32847 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
32848 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
32849 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
32850 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
32851 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
32852 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
32853 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
32854 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
32855 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
32856 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
32857 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
32858 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
32859 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
32860 Self::SET_MODE(..) => SET_MODE_DATA::ID,
32861 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
32862 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
32863 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
32864 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
32865 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
32866 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
32867 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
32868 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
32869 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
32870 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
32871 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
32872 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
32873 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
32874 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
32875 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
32876 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
32877 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32878 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
32879 }
32880 Self::TUNNEL(..) => TUNNEL_DATA::ID,
32881 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
32882 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
32883 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
32884 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
32885 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
32886 Self::VIBRATION(..) => VIBRATION_DATA::ID,
32887 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
32888 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
32889 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
32890 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
32891 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
32892 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
32893 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
32894 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
32895 Self::WIND_COV(..) => WIND_COV_DATA::ID,
32896 }
32897 }
32898 fn message_id_from_name(name: &str) -> Option<u32> {
32899 match name {
32900 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
32901 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
32902 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
32903 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
32904 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
32905 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
32906 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
32907 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
32908 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
32909 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
32910 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
32911 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
32912 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
32913 }
32914 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
32915 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
32916 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
32917 AVSS_DRONE_IMU_DATA::NAME => Some(AVSS_DRONE_IMU_DATA::ID),
32918 AVSS_DRONE_OPERATION_MODE_DATA::NAME => Some(AVSS_DRONE_OPERATION_MODE_DATA::ID),
32919 AVSS_DRONE_POSITION_DATA::NAME => Some(AVSS_DRONE_POSITION_DATA::ID),
32920 AVSS_PRS_SYS_STATUS_DATA::NAME => Some(AVSS_PRS_SYS_STATUS_DATA::ID),
32921 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
32922 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
32923 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
32924 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
32925 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
32926 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
32927 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
32928 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
32929 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
32930 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
32931 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
32932 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
32933 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
32934 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
32935 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
32936 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
32937 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
32938 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
32939 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
32940 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
32941 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
32942 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
32943 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
32944 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
32945 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
32946 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
32947 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
32948 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
32949 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
32950 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
32951 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
32952 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
32953 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
32954 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
32955 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
32956 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
32957 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
32958 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
32959 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
32960 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
32961 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
32962 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
32963 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
32964 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
32965 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
32966 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
32967 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
32968 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
32969 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
32970 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
32971 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
32972 }
32973 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
32974 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
32975 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
32976 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
32977 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
32978 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
32979 }
32980 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
32981 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
32982 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
32983 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
32984 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
32985 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
32986 }
32987 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
32988 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
32989 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
32990 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
32991 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
32992 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
32993 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
32994 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
32995 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
32996 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
32997 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
32998 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
32999 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33000 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
33001 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
33002 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
33003 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33004 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33005 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33006 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
33007 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33008 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
33009 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
33010 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
33011 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
33012 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
33013 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33014 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33015 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
33016 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
33017 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
33018 }
33019 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
33020 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
33021 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33022 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
33023 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33024 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33025 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
33026 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
33027 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33028 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33029 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
33030 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33031 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
33032 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
33033 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33034 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
33035 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
33036 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
33037 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
33038 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
33039 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
33040 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33041 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
33042 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33043 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33044 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
33045 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
33046 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
33047 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
33048 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33049 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33050 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33051 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
33052 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
33053 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
33054 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
33055 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33056 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
33057 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
33058 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33059 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
33060 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33061 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
33062 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
33063 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
33064 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
33065 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
33066 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
33067 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
33068 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
33069 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
33070 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
33071 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
33072 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
33073 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
33074 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
33075 PING_DATA::NAME => Some(PING_DATA::ID),
33076 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
33077 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
33078 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
33079 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
33080 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
33081 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
33082 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
33083 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
33084 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
33085 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
33086 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
33087 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
33088 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
33089 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
33090 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
33091 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
33092 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
33093 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
33094 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
33095 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
33096 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
33097 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33098 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33099 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
33100 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
33101 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
33102 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
33103 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
33104 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
33105 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
33106 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33107 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33108 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33109 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
33110 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
33111 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
33112 }
33113 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
33114 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
33115 }
33116 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33117 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
33118 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
33119 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
33120 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33121 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
33122 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33123 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
33124 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33125 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
33126 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
33127 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
33128 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
33129 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33130 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33131 }
33132 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
33133 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
33134 }
33135 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33136 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
33137 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
33138 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
33139 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
33140 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
33141 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33142 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33143 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33144 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
33145 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
33146 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33147 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
33148 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
33149 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
33150 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
33151 _ => None,
33152 }
33153 }
33154 fn default_message_from_id(id: u32) -> Option<Self> {
33155 match id {
33156 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33157 ACTUATOR_CONTROL_TARGET_DATA::default(),
33158 )),
33159 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33160 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33161 )),
33162 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33163 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33164 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33165 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33166 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33167 ATTITUDE_QUATERNION_DATA::default(),
33168 )),
33169 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33170 ATTITUDE_QUATERNION_COV_DATA::default(),
33171 )),
33172 ATTITUDE_TARGET_DATA::ID => {
33173 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33174 }
33175 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33176 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33177 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33178 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33179 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33180 ))
33181 }
33182 AUTOPILOT_VERSION_DATA::ID => {
33183 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33184 }
33185 AVAILABLE_MODES_DATA::ID => {
33186 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33187 }
33188 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33189 AVAILABLE_MODES_MONITOR_DATA::default(),
33190 )),
33191 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::default())),
33192 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
33193 AVSS_DRONE_OPERATION_MODE_DATA::default(),
33194 )),
33195 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
33196 AVSS_DRONE_POSITION_DATA::default(),
33197 )),
33198 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
33199 AVSS_PRS_SYS_STATUS_DATA::default(),
33200 )),
33201 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33202 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33203 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33204 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33205 CAMERA_CAPTURE_STATUS_DATA::default(),
33206 )),
33207 CAMERA_FOV_STATUS_DATA::ID => {
33208 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33209 }
33210 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33211 CAMERA_IMAGE_CAPTURED_DATA::default(),
33212 )),
33213 CAMERA_INFORMATION_DATA::ID => {
33214 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33215 }
33216 CAMERA_SETTINGS_DATA::ID => {
33217 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33218 }
33219 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33220 CAMERA_THERMAL_RANGE_DATA::default(),
33221 )),
33222 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33223 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33224 )),
33225 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33226 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33227 )),
33228 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33229 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33230 CAN_FILTER_MODIFY_DATA::ID => {
33231 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33232 }
33233 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33234 CELLULAR_CONFIG_DATA::ID => {
33235 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33236 }
33237 CELLULAR_STATUS_DATA::ID => {
33238 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33239 }
33240 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33241 CHANGE_OPERATOR_CONTROL_DATA::default(),
33242 )),
33243 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33244 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33245 )),
33246 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33247 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33248 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33249 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33250 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33251 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33252 COMPONENT_INFORMATION_DATA::default(),
33253 )),
33254 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33255 COMPONENT_INFORMATION_BASIC_DATA::default(),
33256 )),
33257 COMPONENT_METADATA_DATA::ID => {
33258 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33259 }
33260 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33261 CONTROL_SYSTEM_STATE_DATA::default(),
33262 )),
33263 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33264 CURRENT_EVENT_SEQUENCE_DATA::default(),
33265 )),
33266 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33267 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33268 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33269 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33270 )),
33271 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33272 DEBUG_FLOAT_ARRAY_DATA::ID => {
33273 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33274 }
33275 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33276 DISTANCE_SENSOR_DATA::ID => {
33277 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33278 }
33279 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33280 ENCAPSULATED_DATA_DATA::ID => {
33281 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33282 }
33283 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33284 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33285 ESTIMATOR_STATUS_DATA::ID => {
33286 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33287 }
33288 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33289 EXTENDED_SYS_STATE_DATA::ID => {
33290 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33291 }
33292 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33293 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33294 FILE_TRANSFER_PROTOCOL_DATA::default(),
33295 )),
33296 FLIGHT_INFORMATION_DATA::ID => {
33297 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33298 }
33299 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33300 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33301 GENERATOR_STATUS_DATA::ID => {
33302 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33303 }
33304 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33305 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33306 )),
33307 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33308 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33309 )),
33310 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33311 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33312 )),
33313 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33314 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33315 )),
33316 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33317 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33318 )),
33319 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33320 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33321 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33322 ))
33323 }
33324 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33325 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33326 )),
33327 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33328 GIMBAL_MANAGER_STATUS_DATA::default(),
33329 )),
33330 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33331 GLOBAL_POSITION_INT_DATA::default(),
33332 )),
33333 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33334 GLOBAL_POSITION_INT_COV_DATA::default(),
33335 )),
33336 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33337 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33338 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33339 ))
33340 }
33341 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33342 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33343 GPS_GLOBAL_ORIGIN_DATA::ID => {
33344 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33345 }
33346 GPS_INJECT_DATA_DATA::ID => {
33347 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33348 }
33349 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33350 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33351 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33352 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33353 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33354 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33355 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33356 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33357 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33358 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33359 HIL_ACTUATOR_CONTROLS_DATA::default(),
33360 )),
33361 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33362 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33363 HIL_OPTICAL_FLOW_DATA::ID => {
33364 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33365 }
33366 HIL_RC_INPUTS_RAW_DATA::ID => {
33367 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33368 }
33369 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33370 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33371 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33372 HIL_STATE_QUATERNION_DATA::default(),
33373 )),
33374 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33375 HYGROMETER_SENSOR_DATA::ID => {
33376 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33377 }
33378 ILLUMINATOR_STATUS_DATA::ID => {
33379 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33380 }
33381 ISBD_LINK_STATUS_DATA::ID => {
33382 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33383 }
33384 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33385 LINK_NODE_STATUS_DATA::ID => {
33386 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33387 }
33388 LOCAL_POSITION_NED_DATA::ID => {
33389 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33390 }
33391 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33392 LOCAL_POSITION_NED_COV_DATA::default(),
33393 )),
33394 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33395 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33396 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
33397 ))
33398 }
33399 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
33400 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
33401 LOGGING_DATA_ACKED_DATA::ID => {
33402 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
33403 }
33404 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
33405 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
33406 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
33407 LOG_REQUEST_DATA_DATA::ID => {
33408 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
33409 }
33410 LOG_REQUEST_END_DATA::ID => {
33411 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
33412 }
33413 LOG_REQUEST_LIST_DATA::ID => {
33414 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
33415 }
33416 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
33417 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
33418 MANUAL_SETPOINT_DATA::ID => {
33419 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
33420 }
33421 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
33422 MESSAGE_INTERVAL_DATA::ID => {
33423 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
33424 }
33425 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
33426 MISSION_CLEAR_ALL_DATA::ID => {
33427 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
33428 }
33429 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
33430 MISSION_CURRENT_DATA::ID => {
33431 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
33432 }
33433 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
33434 MISSION_ITEM_INT_DATA::ID => {
33435 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
33436 }
33437 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33438 MISSION_ITEM_REACHED_DATA::default(),
33439 )),
33440 MISSION_REQUEST_DATA::ID => {
33441 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
33442 }
33443 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33444 MISSION_REQUEST_INT_DATA::default(),
33445 )),
33446 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33447 MISSION_REQUEST_LIST_DATA::default(),
33448 )),
33449 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33450 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
33451 )),
33452 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33453 MISSION_SET_CURRENT_DATA::default(),
33454 )),
33455 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33456 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
33457 )),
33458 MOUNT_ORIENTATION_DATA::ID => {
33459 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
33460 }
33461 NAMED_VALUE_FLOAT_DATA::ID => {
33462 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
33463 }
33464 NAMED_VALUE_INT_DATA::ID => {
33465 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
33466 }
33467 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33468 NAV_CONTROLLER_OUTPUT_DATA::default(),
33469 )),
33470 OBSTACLE_DISTANCE_DATA::ID => {
33471 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
33472 }
33473 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
33474 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33475 ONBOARD_COMPUTER_STATUS_DATA::default(),
33476 )),
33477 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33478 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
33479 )),
33480 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33481 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
33482 )),
33483 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33484 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
33485 )),
33486 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33487 OPEN_DRONE_ID_LOCATION_DATA::default(),
33488 )),
33489 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33490 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
33491 )),
33492 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33493 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
33494 )),
33495 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33496 OPEN_DRONE_ID_SELF_ID_DATA::default(),
33497 )),
33498 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33499 OPEN_DRONE_ID_SYSTEM_DATA::default(),
33500 )),
33501 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33502 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
33503 )),
33504 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
33505 OPTICAL_FLOW_RAD_DATA::ID => {
33506 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
33507 }
33508 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33509 ORBIT_EXECUTION_STATUS_DATA::default(),
33510 )),
33511 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
33512 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33513 PARAM_EXT_REQUEST_LIST_DATA::default(),
33514 )),
33515 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33516 PARAM_EXT_REQUEST_READ_DATA::default(),
33517 )),
33518 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
33519 PARAM_EXT_VALUE_DATA::ID => {
33520 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
33521 }
33522 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
33523 PARAM_REQUEST_LIST_DATA::ID => {
33524 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
33525 }
33526 PARAM_REQUEST_READ_DATA::ID => {
33527 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
33528 }
33529 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
33530 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
33531 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
33532 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
33533 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
33534 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33535 POSITION_TARGET_GLOBAL_INT_DATA::default(),
33536 )),
33537 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33538 POSITION_TARGET_LOCAL_NED_DATA::default(),
33539 )),
33540 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
33541 PROTOCOL_VERSION_DATA::ID => {
33542 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
33543 }
33544 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
33545 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
33546 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
33547 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
33548 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
33549 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33550 RC_CHANNELS_OVERRIDE_DATA::default(),
33551 )),
33552 RC_CHANNELS_RAW_DATA::ID => {
33553 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
33554 }
33555 RC_CHANNELS_SCALED_DATA::ID => {
33556 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
33557 }
33558 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33559 REQUEST_DATA_STREAM_DATA::default(),
33560 )),
33561 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
33562 RESOURCE_REQUEST_DATA::ID => {
33563 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
33564 }
33565 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33566 RESPONSE_EVENT_ERROR_DATA::default(),
33567 )),
33568 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33569 SAFETY_ALLOWED_AREA_DATA::default(),
33570 )),
33571 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33572 SAFETY_SET_ALLOWED_AREA_DATA::default(),
33573 )),
33574 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
33575 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
33576 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
33577 SCALED_PRESSURE_DATA::ID => {
33578 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
33579 }
33580 SCALED_PRESSURE2_DATA::ID => {
33581 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
33582 }
33583 SCALED_PRESSURE3_DATA::ID => {
33584 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
33585 }
33586 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
33587 SERVO_OUTPUT_RAW_DATA::ID => {
33588 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
33589 }
33590 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
33591 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33592 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
33593 )),
33594 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33595 SET_ATTITUDE_TARGET_DATA::default(),
33596 )),
33597 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33598 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
33599 )),
33600 SET_HOME_POSITION_DATA::ID => {
33601 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
33602 }
33603 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
33604 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33605 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
33606 )),
33607 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33608 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
33609 )),
33610 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
33611 SMART_BATTERY_INFO_DATA::ID => {
33612 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
33613 }
33614 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
33615 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33616 STORAGE_INFORMATION_DATA::default(),
33617 )),
33618 SUPPORTED_TUNES_DATA::ID => {
33619 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
33620 }
33621 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
33622 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
33623 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
33624 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
33625 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
33626 TERRAIN_REQUEST_DATA::ID => {
33627 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
33628 }
33629 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
33630 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
33631 TIME_ESTIMATE_TO_TARGET_DATA::default(),
33632 )),
33633 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33634 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
33635 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
33636 ))
33637 }
33638 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33639 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
33640 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
33641 ))
33642 }
33643 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
33644 UAVCAN_NODE_INFO_DATA::ID => {
33645 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
33646 }
33647 UAVCAN_NODE_STATUS_DATA::ID => {
33648 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
33649 }
33650 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
33651 UTM_GLOBAL_POSITION_DATA::default(),
33652 )),
33653 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
33654 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
33655 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
33656 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
33657 VICON_POSITION_ESTIMATE_DATA::default(),
33658 )),
33659 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
33660 VIDEO_STREAM_INFORMATION_DATA::default(),
33661 )),
33662 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
33663 VIDEO_STREAM_STATUS_DATA::default(),
33664 )),
33665 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
33666 VISION_POSITION_ESTIMATE_DATA::default(),
33667 )),
33668 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
33669 VISION_SPEED_ESTIMATE_DATA::default(),
33670 )),
33671 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
33672 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
33673 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
33674 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
33675 _ => None,
33676 }
33677 }
33678 #[cfg(feature = "arbitrary")]
33679 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
33680 match id {
33681 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33682 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33683 )),
33684 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33685 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
33686 )),
33687 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
33688 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
33689 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
33690 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
33691 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33692 ATTITUDE_QUATERNION_DATA::random(rng),
33693 )),
33694 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33695 ATTITUDE_QUATERNION_COV_DATA::random(rng),
33696 )),
33697 ATTITUDE_TARGET_DATA::ID => {
33698 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
33699 }
33700 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
33701 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
33702 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33703 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33704 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
33705 ))
33706 }
33707 AUTOPILOT_VERSION_DATA::ID => {
33708 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
33709 }
33710 AVAILABLE_MODES_DATA::ID => {
33711 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
33712 }
33713 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33714 AVAILABLE_MODES_MONITOR_DATA::random(rng),
33715 )),
33716 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::random(rng))),
33717 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
33718 AVSS_DRONE_OPERATION_MODE_DATA::random(rng),
33719 )),
33720 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
33721 AVSS_DRONE_POSITION_DATA::random(rng),
33722 )),
33723 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
33724 AVSS_PRS_SYS_STATUS_DATA::random(rng),
33725 )),
33726 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
33727 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
33728 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
33729 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33730 CAMERA_CAPTURE_STATUS_DATA::random(rng),
33731 )),
33732 CAMERA_FOV_STATUS_DATA::ID => {
33733 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
33734 }
33735 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33736 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
33737 )),
33738 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
33739 CAMERA_INFORMATION_DATA::random(rng),
33740 )),
33741 CAMERA_SETTINGS_DATA::ID => {
33742 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
33743 }
33744 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33745 CAMERA_THERMAL_RANGE_DATA::random(rng),
33746 )),
33747 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33748 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
33749 )),
33750 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33751 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
33752 )),
33753 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
33754 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
33755 CAN_FILTER_MODIFY_DATA::ID => {
33756 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
33757 }
33758 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
33759 CELLULAR_CONFIG_DATA::ID => {
33760 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
33761 }
33762 CELLULAR_STATUS_DATA::ID => {
33763 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
33764 }
33765 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33766 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
33767 )),
33768 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33769 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
33770 )),
33771 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
33772 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
33773 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
33774 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
33775 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
33776 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33777 COMPONENT_INFORMATION_DATA::random(rng),
33778 )),
33779 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33780 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
33781 )),
33782 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
33783 COMPONENT_METADATA_DATA::random(rng),
33784 )),
33785 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33786 CONTROL_SYSTEM_STATE_DATA::random(rng),
33787 )),
33788 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33789 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
33790 )),
33791 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
33792 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
33793 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33794 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
33795 )),
33796 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
33797 DEBUG_FLOAT_ARRAY_DATA::ID => {
33798 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
33799 }
33800 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
33801 DISTANCE_SENSOR_DATA::ID => {
33802 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
33803 }
33804 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
33805 ENCAPSULATED_DATA_DATA::ID => {
33806 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
33807 }
33808 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
33809 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
33810 ESTIMATOR_STATUS_DATA::ID => {
33811 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
33812 }
33813 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
33814 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
33815 EXTENDED_SYS_STATE_DATA::random(rng),
33816 )),
33817 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
33818 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33819 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
33820 )),
33821 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
33822 FLIGHT_INFORMATION_DATA::random(rng),
33823 )),
33824 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
33825 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
33826 GENERATOR_STATUS_DATA::ID => {
33827 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
33828 }
33829 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33830 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
33831 )),
33832 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33833 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
33834 )),
33835 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33836 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
33837 )),
33838 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33839 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
33840 )),
33841 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33842 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
33843 )),
33844 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33845 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33846 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
33847 ))
33848 }
33849 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33850 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
33851 )),
33852 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33853 GIMBAL_MANAGER_STATUS_DATA::random(rng),
33854 )),
33855 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33856 GLOBAL_POSITION_INT_DATA::random(rng),
33857 )),
33858 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33859 GLOBAL_POSITION_INT_COV_DATA::random(rng),
33860 )),
33861 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33862 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33863 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
33864 ))
33865 }
33866 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
33867 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
33868 GPS_GLOBAL_ORIGIN_DATA::ID => {
33869 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
33870 }
33871 GPS_INJECT_DATA_DATA::ID => {
33872 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
33873 }
33874 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
33875 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
33876 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
33877 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
33878 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
33879 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
33880 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
33881 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
33882 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
33883 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33884 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
33885 )),
33886 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
33887 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
33888 HIL_OPTICAL_FLOW_DATA::ID => {
33889 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
33890 }
33891 HIL_RC_INPUTS_RAW_DATA::ID => {
33892 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
33893 }
33894 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
33895 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
33896 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33897 HIL_STATE_QUATERNION_DATA::random(rng),
33898 )),
33899 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
33900 HYGROMETER_SENSOR_DATA::ID => {
33901 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
33902 }
33903 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
33904 ILLUMINATOR_STATUS_DATA::random(rng),
33905 )),
33906 ISBD_LINK_STATUS_DATA::ID => {
33907 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
33908 }
33909 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
33910 LINK_NODE_STATUS_DATA::ID => {
33911 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
33912 }
33913 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
33914 LOCAL_POSITION_NED_DATA::random(rng),
33915 )),
33916 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33917 LOCAL_POSITION_NED_COV_DATA::random(rng),
33918 )),
33919 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33920 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33921 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
33922 ))
33923 }
33924 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
33925 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
33926 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
33927 LOGGING_DATA_ACKED_DATA::random(rng),
33928 )),
33929 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
33930 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
33931 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
33932 LOG_REQUEST_DATA_DATA::ID => {
33933 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
33934 }
33935 LOG_REQUEST_END_DATA::ID => {
33936 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
33937 }
33938 LOG_REQUEST_LIST_DATA::ID => {
33939 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
33940 }
33941 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
33942 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
33943 MANUAL_SETPOINT_DATA::ID => {
33944 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
33945 }
33946 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
33947 MESSAGE_INTERVAL_DATA::ID => {
33948 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
33949 }
33950 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
33951 MISSION_CLEAR_ALL_DATA::ID => {
33952 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
33953 }
33954 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
33955 MISSION_CURRENT_DATA::ID => {
33956 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
33957 }
33958 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
33959 MISSION_ITEM_INT_DATA::ID => {
33960 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
33961 }
33962 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33963 MISSION_ITEM_REACHED_DATA::random(rng),
33964 )),
33965 MISSION_REQUEST_DATA::ID => {
33966 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
33967 }
33968 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33969 MISSION_REQUEST_INT_DATA::random(rng),
33970 )),
33971 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33972 MISSION_REQUEST_LIST_DATA::random(rng),
33973 )),
33974 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33975 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
33976 )),
33977 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33978 MISSION_SET_CURRENT_DATA::random(rng),
33979 )),
33980 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33981 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
33982 )),
33983 MOUNT_ORIENTATION_DATA::ID => {
33984 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
33985 }
33986 NAMED_VALUE_FLOAT_DATA::ID => {
33987 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
33988 }
33989 NAMED_VALUE_INT_DATA::ID => {
33990 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
33991 }
33992 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33993 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
33994 )),
33995 OBSTACLE_DISTANCE_DATA::ID => {
33996 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
33997 }
33998 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
33999 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34000 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
34001 )),
34002 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34003 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
34004 )),
34005 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34006 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
34007 )),
34008 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34009 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34010 )),
34011 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34012 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
34013 )),
34014 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34015 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
34016 )),
34017 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34018 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34019 )),
34020 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34021 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
34022 )),
34023 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34024 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34025 )),
34026 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34027 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
34028 )),
34029 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
34030 OPTICAL_FLOW_RAD_DATA::ID => {
34031 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
34032 }
34033 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34034 ORBIT_EXECUTION_STATUS_DATA::random(rng),
34035 )),
34036 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
34037 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34038 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
34039 )),
34040 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34041 PARAM_EXT_REQUEST_READ_DATA::random(rng),
34042 )),
34043 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34044 PARAM_EXT_VALUE_DATA::ID => {
34045 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
34046 }
34047 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34048 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
34049 PARAM_REQUEST_LIST_DATA::random(rng),
34050 )),
34051 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34052 PARAM_REQUEST_READ_DATA::random(rng),
34053 )),
34054 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34055 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
34056 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
34057 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
34058 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
34059 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34060 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34061 )),
34062 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34063 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34064 )),
34065 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34066 PROTOCOL_VERSION_DATA::ID => {
34067 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
34068 }
34069 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
34070 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
34071 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
34072 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
34073 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
34074 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34075 RC_CHANNELS_OVERRIDE_DATA::random(rng),
34076 )),
34077 RC_CHANNELS_RAW_DATA::ID => {
34078 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
34079 }
34080 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
34081 RC_CHANNELS_SCALED_DATA::random(rng),
34082 )),
34083 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34084 REQUEST_DATA_STREAM_DATA::random(rng),
34085 )),
34086 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
34087 RESOURCE_REQUEST_DATA::ID => {
34088 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
34089 }
34090 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34091 RESPONSE_EVENT_ERROR_DATA::random(rng),
34092 )),
34093 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34094 SAFETY_ALLOWED_AREA_DATA::random(rng),
34095 )),
34096 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34097 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
34098 )),
34099 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
34100 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
34101 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
34102 SCALED_PRESSURE_DATA::ID => {
34103 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
34104 }
34105 SCALED_PRESSURE2_DATA::ID => {
34106 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
34107 }
34108 SCALED_PRESSURE3_DATA::ID => {
34109 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
34110 }
34111 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
34112 SERVO_OUTPUT_RAW_DATA::ID => {
34113 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
34114 }
34115 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
34116 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34117 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34118 )),
34119 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34120 SET_ATTITUDE_TARGET_DATA::random(rng),
34121 )),
34122 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34123 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34124 )),
34125 SET_HOME_POSITION_DATA::ID => {
34126 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
34127 }
34128 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
34129 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34130 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34131 )),
34132 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34133 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34134 )),
34135 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34136 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
34137 SMART_BATTERY_INFO_DATA::random(rng),
34138 )),
34139 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
34140 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34141 STORAGE_INFORMATION_DATA::random(rng),
34142 )),
34143 SUPPORTED_TUNES_DATA::ID => {
34144 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34145 }
34146 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34147 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34148 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34149 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34150 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34151 TERRAIN_REQUEST_DATA::ID => {
34152 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34153 }
34154 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34155 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34156 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34157 )),
34158 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34159 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34160 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34161 ))
34162 }
34163 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34164 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34165 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
34166 ))
34167 }
34168 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34169 UAVCAN_NODE_INFO_DATA::ID => {
34170 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
34171 }
34172 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
34173 UAVCAN_NODE_STATUS_DATA::random(rng),
34174 )),
34175 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34176 UTM_GLOBAL_POSITION_DATA::random(rng),
34177 )),
34178 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
34179 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
34180 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34181 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34182 VICON_POSITION_ESTIMATE_DATA::random(rng),
34183 )),
34184 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34185 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34186 )),
34187 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34188 VIDEO_STREAM_STATUS_DATA::random(rng),
34189 )),
34190 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34191 VISION_POSITION_ESTIMATE_DATA::random(rng),
34192 )),
34193 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34194 VISION_SPEED_ESTIMATE_DATA::random(rng),
34195 )),
34196 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
34197 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
34198 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
34199 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
34200 _ => None,
34201 }
34202 }
34203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34204 match self {
34205 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34206 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34207 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34208 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34209 Self::ALTITUDE(body) => body.ser(version, bytes),
34210 Self::ATTITUDE(body) => body.ser(version, bytes),
34211 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34212 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34213 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34214 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34215 Self::AUTH_KEY(body) => body.ser(version, bytes),
34216 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34217 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34218 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34219 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34220 Self::AVSS_DRONE_IMU(body) => body.ser(version, bytes),
34221 Self::AVSS_DRONE_OPERATION_MODE(body) => body.ser(version, bytes),
34222 Self::AVSS_DRONE_POSITION(body) => body.ser(version, bytes),
34223 Self::AVSS_PRS_SYS_STATUS(body) => body.ser(version, bytes),
34224 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34225 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34226 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34227 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34228 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34229 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34230 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34231 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34232 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34233 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34234 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34235 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34236 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34237 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34238 Self::CAN_FRAME(body) => body.ser(version, bytes),
34239 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34240 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34241 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34242 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34243 Self::COLLISION(body) => body.ser(version, bytes),
34244 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34245 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34246 Self::COMMAND_INT(body) => body.ser(version, bytes),
34247 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34248 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34249 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34250 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34251 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34252 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34253 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34254 Self::DATA_STREAM(body) => body.ser(version, bytes),
34255 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34256 Self::DEBUG(body) => body.ser(version, bytes),
34257 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34258 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34259 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34260 Self::EFI_STATUS(body) => body.ser(version, bytes),
34261 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34262 Self::ESC_INFO(body) => body.ser(version, bytes),
34263 Self::ESC_STATUS(body) => body.ser(version, bytes),
34264 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34265 Self::EVENT(body) => body.ser(version, bytes),
34266 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34267 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34268 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34269 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34270 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34271 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34272 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34273 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34274 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34275 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34276 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34277 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34278 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34279 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34280 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34281 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34282 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34283 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34284 Self::GPS2_RAW(body) => body.ser(version, bytes),
34285 Self::GPS2_RTK(body) => body.ser(version, bytes),
34286 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34287 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34288 Self::GPS_INPUT(body) => body.ser(version, bytes),
34289 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34290 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34291 Self::GPS_RTK(body) => body.ser(version, bytes),
34292 Self::GPS_STATUS(body) => body.ser(version, bytes),
34293 Self::HEARTBEAT(body) => body.ser(version, bytes),
34294 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34295 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34296 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34297 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34298 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34299 Self::HIL_GPS(body) => body.ser(version, bytes),
34300 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34301 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34302 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34303 Self::HIL_STATE(body) => body.ser(version, bytes),
34304 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34305 Self::HOME_POSITION(body) => body.ser(version, bytes),
34306 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34307 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34308 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34309 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34310 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34311 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34312 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34313 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34314 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34315 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34316 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34317 Self::LOG_DATA(body) => body.ser(version, bytes),
34318 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34319 Self::LOG_ERASE(body) => body.ser(version, bytes),
34320 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34321 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34322 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34323 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34324 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34325 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34326 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34327 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34328 Self::MISSION_ACK(body) => body.ser(version, bytes),
34329 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34330 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34331 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34332 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34333 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34334 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34335 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34336 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34337 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34338 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34339 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34340 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34341 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34342 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34343 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34344 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34345 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34346 Self::ODOMETRY(body) => body.ser(version, bytes),
34347 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34348 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34349 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34350 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34351 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34352 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34353 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34354 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
34355 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
34356 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
34357 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
34358 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
34359 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
34360 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
34361 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
34362 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
34363 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
34364 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
34365 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
34366 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
34367 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
34368 Self::PARAM_SET(body) => body.ser(version, bytes),
34369 Self::PARAM_VALUE(body) => body.ser(version, bytes),
34370 Self::PING(body) => body.ser(version, bytes),
34371 Self::PLAY_TUNE(body) => body.ser(version, bytes),
34372 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
34373 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34374 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34375 Self::POWER_STATUS(body) => body.ser(version, bytes),
34376 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
34377 Self::RADIO_STATUS(body) => body.ser(version, bytes),
34378 Self::RAW_IMU(body) => body.ser(version, bytes),
34379 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
34380 Self::RAW_RPM(body) => body.ser(version, bytes),
34381 Self::RC_CHANNELS(body) => body.ser(version, bytes),
34382 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
34383 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
34384 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
34385 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
34386 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
34387 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
34388 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
34389 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
34390 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
34391 Self::SCALED_IMU(body) => body.ser(version, bytes),
34392 Self::SCALED_IMU2(body) => body.ser(version, bytes),
34393 Self::SCALED_IMU3(body) => body.ser(version, bytes),
34394 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
34395 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
34396 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
34397 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
34398 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
34399 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
34400 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34401 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
34402 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34403 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
34404 Self::SET_MODE(body) => body.ser(version, bytes),
34405 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34406 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34407 Self::SIM_STATE(body) => body.ser(version, bytes),
34408 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
34409 Self::STATUSTEXT(body) => body.ser(version, bytes),
34410 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
34411 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
34412 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
34413 Self::SYS_STATUS(body) => body.ser(version, bytes),
34414 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
34415 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
34416 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
34417 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
34418 Self::TIMESYNC(body) => body.ser(version, bytes),
34419 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
34420 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
34421 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
34422 Self::TUNNEL(body) => body.ser(version, bytes),
34423 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
34424 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
34425 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
34426 Self::V2_EXTENSION(body) => body.ser(version, bytes),
34427 Self::VFR_HUD(body) => body.ser(version, bytes),
34428 Self::VIBRATION(body) => body.ser(version, bytes),
34429 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34430 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34431 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
34432 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34433 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
34434 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
34435 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
34436 Self::WINCH_STATUS(body) => body.ser(version, bytes),
34437 Self::WIND_COV(body) => body.ser(version, bytes),
34438 }
34439 }
34440 fn extra_crc(id: u32) -> u8 {
34441 match id {
34442 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34443 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
34444 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
34445 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
34446 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
34447 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
34448 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
34449 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
34450 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
34451 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
34452 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
34453 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34454 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
34455 }
34456 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
34457 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
34458 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
34459 AVSS_DRONE_IMU_DATA::ID => AVSS_DRONE_IMU_DATA::EXTRA_CRC,
34460 AVSS_DRONE_OPERATION_MODE_DATA::ID => AVSS_DRONE_OPERATION_MODE_DATA::EXTRA_CRC,
34461 AVSS_DRONE_POSITION_DATA::ID => AVSS_DRONE_POSITION_DATA::EXTRA_CRC,
34462 AVSS_PRS_SYS_STATUS_DATA::ID => AVSS_PRS_SYS_STATUS_DATA::EXTRA_CRC,
34463 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
34464 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
34465 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
34466 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
34467 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
34468 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
34469 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
34470 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
34471 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
34472 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
34473 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
34474 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
34475 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
34476 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
34477 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
34478 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
34479 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
34480 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
34481 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
34482 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
34483 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
34484 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
34485 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
34486 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
34487 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
34488 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
34489 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
34490 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
34491 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
34492 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
34493 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
34494 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
34495 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
34496 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
34497 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
34498 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
34499 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
34500 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
34501 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
34502 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
34503 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
34504 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
34505 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
34506 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
34507 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
34508 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
34509 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
34510 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
34511 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
34512 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
34513 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
34514 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
34515 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
34516 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
34517 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34518 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
34519 }
34520 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
34521 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
34522 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
34523 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
34524 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34525 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
34526 }
34527 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
34528 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
34529 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34530 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
34531 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
34532 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
34533 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
34534 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
34535 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
34536 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
34537 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
34538 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
34539 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
34540 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
34541 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
34542 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
34543 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
34544 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
34545 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
34546 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
34547 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
34548 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
34549 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
34550 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
34551 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
34552 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
34553 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
34554 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
34555 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
34556 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34557 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
34558 }
34559 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
34560 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
34561 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
34562 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
34563 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
34564 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
34565 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
34566 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
34567 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
34568 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
34569 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
34570 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
34571 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
34572 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
34573 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
34574 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
34575 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
34576 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
34577 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
34578 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
34579 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
34580 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
34581 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
34582 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
34583 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
34584 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
34585 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
34586 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
34587 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
34588 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
34589 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
34590 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
34591 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
34592 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
34593 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
34594 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
34595 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
34596 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
34597 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
34598 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
34599 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
34600 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
34601 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
34602 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
34603 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
34604 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
34605 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
34606 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
34607 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
34608 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
34609 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
34610 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
34611 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
34612 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
34613 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
34614 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
34615 PING_DATA::ID => PING_DATA::EXTRA_CRC,
34616 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
34617 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
34618 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
34619 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34620 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
34621 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
34622 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
34623 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
34624 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
34625 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
34626 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
34627 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
34628 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
34629 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
34630 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
34631 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
34632 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
34633 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
34634 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
34635 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
34636 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
34637 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
34638 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
34639 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
34640 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
34641 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
34642 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
34643 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
34644 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
34645 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34646 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
34647 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34648 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
34649 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
34650 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34651 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
34652 }
34653 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34654 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
34655 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
34656 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
34657 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
34658 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
34659 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
34660 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
34661 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
34662 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
34663 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
34664 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
34665 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
34666 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
34667 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34668 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
34669 }
34670 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34671 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
34672 }
34673 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
34674 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
34675 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
34676 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
34677 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
34678 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
34679 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
34680 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34681 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
34682 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
34683 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34684 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
34685 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
34686 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
34687 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
34688 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
34689 _ => 0,
34690 }
34691 }
34692 fn target_system_id(&self) -> Option<u8> {
34693 match self {
34694 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
34695 Self::CANFD_FRAME(inner) => Some(inner.target_system),
34696 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
34697 Self::CAN_FRAME(inner) => Some(inner.target_system),
34698 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
34699 Self::COMMAND_ACK(inner) => Some(inner.target_system),
34700 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
34701 Self::COMMAND_INT(inner) => Some(inner.target_system),
34702 Self::COMMAND_LONG(inner) => Some(inner.target_system),
34703 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
34704 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
34705 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
34706 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
34707 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
34708 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
34709 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
34710 Self::LOGGING_ACK(inner) => Some(inner.target_system),
34711 Self::LOGGING_DATA(inner) => Some(inner.target_system),
34712 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
34713 Self::LOG_ERASE(inner) => Some(inner.target_system),
34714 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
34715 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
34716 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
34717 Self::MISSION_ACK(inner) => Some(inner.target_system),
34718 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
34719 Self::MISSION_COUNT(inner) => Some(inner.target_system),
34720 Self::MISSION_ITEM(inner) => Some(inner.target_system),
34721 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
34722 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
34723 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
34724 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
34725 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
34726 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
34727 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
34728 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
34729 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
34730 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
34731 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
34732 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
34733 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
34734 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
34735 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
34736 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
34737 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
34738 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
34739 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
34740 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
34741 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
34742 Self::PARAM_SET(inner) => Some(inner.target_system),
34743 Self::PING(inner) => Some(inner.target_system),
34744 Self::PLAY_TUNE(inner) => Some(inner.target_system),
34745 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
34746 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
34747 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
34748 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
34749 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
34750 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
34751 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
34752 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
34753 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
34754 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
34755 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
34756 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
34757 Self::SET_MODE(inner) => Some(inner.target_system),
34758 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
34759 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
34760 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
34761 Self::TIMESYNC(inner) => Some(inner.target_system),
34762 Self::TUNNEL(inner) => Some(inner.target_system),
34763 Self::V2_EXTENSION(inner) => Some(inner.target_system),
34764 _ => None,
34765 }
34766 }
34767 fn target_component_id(&self) -> Option<u8> {
34768 match self {
34769 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
34770 Self::CANFD_FRAME(inner) => Some(inner.target_component),
34771 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
34772 Self::CAN_FRAME(inner) => Some(inner.target_component),
34773 Self::COMMAND_ACK(inner) => Some(inner.target_component),
34774 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
34775 Self::COMMAND_INT(inner) => Some(inner.target_component),
34776 Self::COMMAND_LONG(inner) => Some(inner.target_component),
34777 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
34778 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
34779 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
34780 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
34781 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
34782 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
34783 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
34784 Self::LOGGING_ACK(inner) => Some(inner.target_component),
34785 Self::LOGGING_DATA(inner) => Some(inner.target_component),
34786 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
34787 Self::LOG_ERASE(inner) => Some(inner.target_component),
34788 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
34789 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
34790 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
34791 Self::MISSION_ACK(inner) => Some(inner.target_component),
34792 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
34793 Self::MISSION_COUNT(inner) => Some(inner.target_component),
34794 Self::MISSION_ITEM(inner) => Some(inner.target_component),
34795 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
34796 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
34797 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
34798 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
34799 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
34800 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
34801 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
34802 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
34803 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
34804 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
34805 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
34806 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
34807 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
34808 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
34809 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
34810 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
34811 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
34812 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
34813 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
34814 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
34815 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
34816 Self::PARAM_SET(inner) => Some(inner.target_component),
34817 Self::PING(inner) => Some(inner.target_component),
34818 Self::PLAY_TUNE(inner) => Some(inner.target_component),
34819 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
34820 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
34821 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
34822 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
34823 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
34824 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
34825 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
34826 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
34827 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
34828 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
34829 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
34830 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
34831 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
34832 Self::TIMESYNC(inner) => Some(inner.target_component),
34833 Self::TUNNEL(inner) => Some(inner.target_component),
34834 Self::V2_EXTENSION(inner) => Some(inner.target_component),
34835 _ => None,
34836 }
34837 }
34838}